you can see in the grunt file for reference this code that traverses an array of all tasks - currently starts at line 106
exports.tasks = function() { grunt.log.header('Available tasks'); if (exports._tasks.length === 0) { grunt.log.writeln('(no tasks found)'); } else { exports.table(exports._tasks.map(function(task) { var info = task.info; if (task.multi) { info += ' *'; } return [task.name, info]; })); ...
this means that we have to look where this array is filled - (currently starts at line 94) :
exports.initTasks = function() {
here you can see that there is a loop over all registered tasks (grunt.task._tasks object). there is no check inside the loop, so now you need to see where this object is filled.
and this is done in registerTask-prototype-method (currently line 78) :
// Register a new task. Task.prototype.registerTask = function(name, info, fn) { ... some other code // Add task into cache. this._tasks[name] = {name: name, info: info, fn: fn};
now this means that there is NO for your question. you cannot register a task that will not display on --help.
but there is a problem submitted to the guntum grunt repository for your problem (private tasks). Feel free to fork the repository, do this work and give it to the community; -)
source share