Reputation: 15006
I'm not really sure on what level this terminology exists, but in the php-framework Laravel there is a command-line-tool called Artisan that is being used for creating cronjobs. (aka commands) When you create a command. You can specify arguments AND options like this:
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('example', InputArgument::REQUIRED, 'An example argument.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
);
}
What's the difference between the two?
Upvotes: 24
Views: 6909
Reputation: 87719
Take a look at the artisan migrate:make
help:
Usage:
migrate:make [--bench[="..."]] [--create] [--package[="..."]] [--path[="..."]] [--table[="..."]] name
Arguments:
name The name of the migration
Options:
--bench The workbench the migration belongs to.
--create The table needs to be created.
--package The package the migration belongs to.
--path Where to store the migration.
--table The table to migrate.
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
--env The environment the command should run under.
Argument is something you usually need to provide at least one, in this case you need to provide the migration name or the command will raise an error.
Option is, obviously, optional, something that you use to modify the command behaviour.
Upvotes: 27