Development

Changeset 6857

You must first sign up to be able to contribute.

Changeset 6857

Show
Ignore:
Timestamp:
12/31/07 17:05:09 (10 months ago)
Author:
fabien
Message:

fixed calling tasks in a script with options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/task/sfTask.class.php

    r5232 r6857  
    8686    $commandManager = new sfCommandManager(new sfCommandArgumentSet($this->getArguments()), new sfCommandOptionSet($this->getOptions())); 
    8787 
    88     return $this->doRun($commandManager, array_merge($arguments, $options)); 
     88    // add -- before each option if needed 
     89    foreach ($options as &$option) 
     90    { 
     91      if (0 !== strpos($option, '--')) 
     92      { 
     93        $option = '--'.$option; 
     94      } 
     95    } 
     96 
     97    return $this->doRun($commandManager, implode(' ', array_merge($arguments, $options))); 
    8998  } 
    9099