gruntjs/grunt — pull request #952 by stephanebachelier (2013-10-21 13:46:22+00:00)
Title: Added ability to not run a specific task by passing --no-<taskname> on CLI

The use case supported by this commit is to disable the running of specific tasks.

An example is better. Given this Gruntfile:

```
'use strict';

module.exports = function(grunt) {
grunt.file.setBase('../fixtures/files');

grunt.initConfig({
a: function () {
grunt.log.writeln('task a run');
},
b: function () {
grunt.log.writeln('task b run');
},
c: function () {
grunt.log.writeln('task c run');
},
log: {
foo: [1, 2, 3],
bar: 'hello world',
baz: false
}
});

grunt.registerTask('build', [
'a',
'b',
'c'
]);

grunt.registerMultiTask('log', 'Log stuff.', function() {
grunt.log.writeln(this.target + ': ' + this.data);
});

grunt.registerMultiTask('default', [
'build',
'log'
]);
```

Running the following :
```
grunt build --no-b
```

will output:
```
task a run
task c run
```

```
grunt log --no-log-bar
```

will output:
```
foo: 1,2,3
baz: false
```

It is also possible to deactive task from multi task:

```
grunt --no-log-bar --no-b
```

will run default task
```
task a run
task c run
foo: 1,2,3
baz: false
```