Changeset 4354
- Timestamp:
- 06/25/07 10:13:02 (1 year ago)
- Files:
-
- tools/pake/trunk/lib/pake/pakeApp.class.php (modified) (2 diffs)
- tools/pake/trunk/lib/pake/pakeTask.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/pake/trunk/lib/pake/pakeApp.class.php
r2574 r4354 124 124 $task = array_shift($args); 125 125 126 $options = array(); 127 for ($i = 0, $max = count($args); $i < $max; $i++) 128 { 129 if (0 === strpos($args[$i], '--')) 130 { 131 if (false !== $pos = strpos($args[$i], '=')) 132 { 133 $options[substr($args[$i], 2, $pos - 2)] = substr($args[$i], $pos + 1); 134 } 135 else 136 { 137 $options[substr($args[$i], 2)] = true; 138 } 139 unset($args[$i]); 140 } 141 } 142 $args = array_values($args); 143 126 144 $abbrev_options = $this->abbrev(array_keys(pakeTask::get_tasks())); 127 145 $task = pakeTask::get_full_task_name($task); … … 141 159 else 142 160 { 143 return pakeTask::get($abbrev_options[$task][0])->invoke($args );161 return pakeTask::get($abbrev_options[$task][0])->invoke($args, $options); 144 162 } 145 163 } tools/pake/trunk/lib/pake/pakeTask.class.php
r1794 r4354 150 150 } 151 151 152 public function invoke($args )152 public function invoke($args, $options) 153 153 { 154 154 if ($this->trace) … … 179 179 if ($this->is_needed()) 180 180 { 181 return $this->execute($args );182 } 183 } 184 185 public function execute($args )181 return $this->execute($args, $options); 182 } 183 } 184 185 public function execute($args, $options) 186 186 { 187 187 if ($this->dryrun) … … 216 216 217 217 // execute action 218 return call_user_func_array($function, array($this, $args ));218 return call_user_func_array($function, array($this, $args, $options)); 219 219 } 220 220