Development

Changeset 8305

You must first sign up to be able to contribute.

Changeset 8305

Show
Ignore:
Timestamp:
04/04/08 20:28:02 (6 months ago)
Author:
fabien
Message:

added sfTask::addOption() and sfTask::addArgument()

Files:

Legend:

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

    r7814 r8305  
    119119 
    120120  /** 
     121   * Add an argument. 
     122   * 
     123   * This method always use the sfCommandArgument class to create an option. 
     124   * 
     125   * @see sfCommandArgument::__construct() 
     126   */ 
     127  public function addArgument($name, $mode = null, $help = '', $default = null) 
     128  { 
     129    $this->arguments[] = new sfCommandArgument($name, $mode, $help, $default); 
     130  } 
     131 
     132  /** 
    121133   * Returns the options objects. 
    122134   * 
     
    136148  { 
    137149    $this->options = array_merge($this->options, $options); 
     150  } 
     151 
     152  /** 
     153   * Add an option. 
     154   * 
     155   * This method always use the sfCommandOption class to create an option. 
     156   * 
     157   * @see sfCommandOption::__construct() 
     158   */ 
     159  public function addOption($name, $shortcut = null, $mode = null, $help = '', $default = null) 
     160  { 
     161    $this->options[] = new sfCommandOption($name, $shortcut, $mode, $help, $default); 
    138162  } 
    139163