@@ 356-358 (lines=3) @@ | ||
353 | // The robo class may contain multiple commands; the user may |
|
354 | // select which one to run, or even get a list of commands or |
|
355 | // run 'help' on any of the available commands as usual. |
|
356 | if ((count($args) > 1) && $this->isShebangFile($args[1])) { |
|
357 | return array_merge([$args[0]], array_slice($args, 2)); |
|
358 | } |
|
359 | // Option 2: Shebang line stipulates which command to run. |
|
360 | // #!/bin/env robo mycommand |
|
361 | // The robo class must contain a public method named 'mycommand'. |
|
@@ 364-366 (lines=3) @@ | ||
361 | // The robo class must contain a public method named 'mycommand'. |
|
362 | // This command will be executed every time. Arguments and options |
|
363 | // may be provided on the commandline as usual. |
|
364 | if ((count($args) > 2) && $this->isShebangFile($args[2])) { |
|
365 | return array_merge([$args[0]], explode(' ', $args[1]), array_slice($args, 3)); |
|
366 | } |
|
367 | return $args; |
|
368 | } |
|
369 |