dgmike
5/29/2014 - 7:44 PM

complete.js

/*jslint node: true*/

var grunt = require('grunt'),
    gruntFile = require('./Gruntfile.js'),
    task,
    tasks;
    
gruntFile(grunt);

task = process.argv.length > 2 ? process.argv[2] : '';

task = task.split(':');
task.pop();

tasks = grunt.config.data;
task.forEach(function (item) {
    "use strict";
    if (tasks.hasOwnProperty(item)) {
        tasks = tasks[item];
    }
});

console.log('tasks: ' + Object.keys(tasks).join(' '));