Console command option issues?
This is an open discussion with 1 reply, filed under Troubleshooting.
Search
This forum is for Symphony CMS, a content management system which is not related to the framework called Symfony.
Create an account or sign in to comment.
Hi
Do command options work as intended?
I have created a small console app with the command 'test' that just dumps out the following option value:
$this->addOption( 'boolean', 'b', InputOption::VALUE_OPTIONAL, 'A boolean value (defaults to false).', false );
Test 1: php command-test.php test Result: bool(false)
Test 2: php command-test.php test --boolean Result: bool(false) * Should this not be bool(true)?
Test 3: php command-test.php test -b Result: bool(false)
Test 4: php command-test.php test -b=true string(5) "=true" * Why is the = sign included?
Test 5: php command-test.php test --boolean=true string(4) "true" * Different result to the -b, no = sign.
Is this expected behaviour? How do you toggle boolean options via the command line?
Thanks for your help.
Cheers Sheath