Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refs #4488 - Support supplying the minion task name as a positional a…

…rgument rather than --task=
  • Loading branch information...
commit 48b5299e998eadcbed5488e55d679c198565bd55 1 parent 0e326d5
@kiall kiall authored
Showing with 13 additions and 6 deletions.
  1. +2 −1  classes/Kohana/Minion/CLI.php
  2. +11 −5 classes/Kohana/Minion/Task.php
View
3  classes/Kohana/Minion/CLI.php
@@ -67,7 +67,8 @@ public static function options($options = NULL)
if (substr($opt, 0, 2) !== '--')
{
- // This is not an option argument
+ // This is a positional argument
+ $values[] = $opt;
continue;
}
View
16 classes/Kohana/Minion/Task.php
@@ -59,12 +59,18 @@ public static function convert_class_to_task($class)
*/
public static function factory($options)
{
- $task = Arr::get($options, 'task');
- unset($options['task']);
-
- // If we didn't get a valid task, generate the help
- if ( ! is_string($task))
+ if (($task = Arr::get($options, 'task')) !== NULL)
+ {
+ unset($options['task']);
+ }
+ else if (($task = Arr::get($options, 0)) !== NULL)
+ {
+ // The first positional argument (aka 0) may be the task name
+ unset($options[0]);
+ }
+ else
{
+ // If we didn't get a valid task, generate the help
$task = 'help';
}
Please sign in to comment.
Something went wrong with that request. Please try again.