How to use the cli function from grunt
Find comprehensive JavaScript grunt.cli code examples handpicked from public code repositorys.
GitHub: gruntjs/grunt-init

44 45 46 47 48 49 50 51 52 53
grunt.cli.tasks = ['init']; } else { name = grunt.cli.tasks[0]; // For the specified "task" prepend "init:" so the init task doesn't // actually need to be specified on the command line. grunt.cli.tasks = ['init:' + name]; } // Remove grunt options that don't really make any sense for grunt-init. [
+ 7 other calls in file
GitHub: phated/grunt-enyo

92 93 94 95 96 97 98 99 100 101
}); var tasks = map(enyoTasks, grunt.task._tasks); var inits = map(enyoInits, initDefs); var bowers = map(enyoBowers, grunt.task._tasks); var opts = map(enyoOptions, grunt.cli.optlist, true); function displayTasks(header, tasks) { grunt.log.header(header.cyan.bold);
GitHub: spmjs/spm-init

55 56 57 58 59 60 61 62
function runTask() { grunt.task.loadTasks(path.join(__dirname, '../node_modules/grunt-init/tasks')); // fix windows directory by replace C:\ to C\:\ var taskName = 'init:' + template.replace(/^([a-zA-Z]):\\/, '$1\\:\\'); grunt.cli.tasks = [taskName]; grunt.cli({}); }
+ 3 other calls in file
GitHub: eclifford/towelie

42 43 44 45 46 47 48 49 50 51
// Borrowed heavily from the Grunt help source. var col1len = 0; var opts = Object.keys(grunt.cli.optlist).map(function(long) { var o = grunt.cli.optlist[long]; var col1 = '--' + (o.negate ? 'no-' : '') + long + (o.short ? ', -' + o.short : ''); col1len = Math.max(col1len, col1.length); return [col1, o.info]; });
GitHub: toastjs/toast

79 80 81 82 83 84 85
// Do not proceed further. return displayHelp(); } // Otherwise, invoke the CLI. grunt.cli(); });
+ 15 other calls in file
grunt.file is the most popular function in grunt (372 examples)