|
@@ 338-340 (lines=3) @@
|
| 335 |
|
// The robo class may contain multiple commands; the user may |
| 336 |
|
// select which one to run, or even get a list of commands or |
| 337 |
|
// run 'help' on any of the available commands as usual. |
| 338 |
|
if ((count($args) > 1) && $this->isShebangFile($args[1])) { |
| 339 |
|
return array_merge([$args[0]], array_slice($args, 2)); |
| 340 |
|
} |
| 341 |
|
// Option 2: Shebang line stipulates which command to run. |
| 342 |
|
// #!/bin/env robo mycommand |
| 343 |
|
// The robo class must contain a public method named 'mycommand'. |
|
@@ 346-348 (lines=3) @@
|
| 343 |
|
// The robo class must contain a public method named 'mycommand'. |
| 344 |
|
// This command will be executed every time. Arguments and options |
| 345 |
|
// may be provided on the commandline as usual. |
| 346 |
|
if ((count($args) > 2) && $this->isShebangFile($args[2])) { |
| 347 |
|
return array_merge([$args[0]], explode(' ', $args[1]), array_slice($args, 3)); |
| 348 |
|
} |
| 349 |
|
return $args; |
| 350 |
|
} |
| 351 |
|
|