gruntjs / grunt-cli

Grunt's command line interface.
http://gruntjs.com/
MIT License
706 stars 248 forks source link

gruntfile option is part of grunt.option.flags() #126

Open henryruhs opened 5 years ago

henryruhs commented 5 years ago

Since release 1.3.x the --gruntfile option is part of grunt.option.flags().

This is causing issues while running grunt shell or similar tasks as an unknown option is being passed to an operation that might / will return an error.

Fragment of the grunt-shell task:

{
        phpunit:
        {
            command:'vendor/bin/phpunit ' + grunt.option.flags()
        }
}

Error reported by PHPUnit:

Running "shell:phpunit" (shell) task
PHPUnit 7.4.3 by Sebastian Bergmann and contributors.

unrecognized option --gruntfile
Warning: Command failed: vendor/bin/phpunit --gruntfile=/home/redaxmedia/PhpstormProjects/redaxscript/gruntfile.js
 Use --force to continue.

Verbose information:

grunt phpunit --verbose
Initializing
Command-line options: --verbose, --gruntfile=/home/redaxmedia/PhpstormProjects/redaxscript/gruntfile.js