|
@@ 378-380 (lines=3) @@
|
| 375 |
|
// The robo class may contain multiple commands; the user may |
| 376 |
|
// select which one to run, or even get a list of commands or |
| 377 |
|
// run 'help' on any of the available commands as usual. |
| 378 |
|
if ((count($args) > 1) && $this->isShebangFile($args[1])) { |
| 379 |
|
return array_merge([$args[0]], array_slice($args, 2)); |
| 380 |
|
} |
| 381 |
|
// Option 2: Shebang line stipulates which command to run. |
| 382 |
|
// #!/bin/env robo mycommand |
| 383 |
|
// The robo class must contain a public method named 'mycommand'. |
|
@@ 386-388 (lines=3) @@
|
| 383 |
|
// The robo class must contain a public method named 'mycommand'. |
| 384 |
|
// This command will be executed every time. Arguments and options |
| 385 |
|
// may be provided on the commandline as usual. |
| 386 |
|
if ((count($args) > 2) && $this->isShebangFile($args[2])) { |
| 387 |
|
return array_merge([$args[0]], explode(' ', $args[1]), array_slice($args, 3)); |
| 388 |
|
} |
| 389 |
|
return $args; |
| 390 |
|
} |
| 391 |
|
|