我并不确定这个术语的级别,但在php框架Laravel中有一个命令行工具叫做Artisan,用于创建cronjobs(也称为命令)。当你创建一个命令时,可以像这样指定参数和选项:
/**
* 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),
);
}
这两者有什么区别?