@@ 280-298 (lines=19) @@ | ||
277 | * |
|
278 | * @return string |
|
279 | */ |
|
280 | protected function GenCmdOption () { |
|
281 | if (empty($this->aCmdOption)) { |
|
282 | return ''; |
|
283 | } |
|
284 | else { |
|
285 | $s = ' '; |
|
286 | foreach ($this->aCmdOption as $v) { |
|
287 | // Single char param without '-' |
|
288 | if (1 == strlen($v)) |
|
289 | $v = '-' . $v; |
|
290 | // Multi char param without '--' |
|
291 | if (1 < strlen($v) && '--' != substr($v, 0, 2)) |
|
292 | $v = '--' . $v; |
|
293 | ||
294 | $s .= $v . ' '; |
|
295 | } |
|
296 | return $s; |
|
297 | } |
|
298 | } // end of func GenCmdOption |
|
299 | ||
300 | ||
301 | /** |
@@ 170-190 (lines=21) @@ | ||
167 | * |
|
168 | * @return string |
|
169 | */ |
|
170 | protected function genCmdOptionString() |
|
171 | { |
|
172 | if (empty($this->cmdOption)) { |
|
173 | return ''; |
|
174 | } else { |
|
175 | $s = ' '; |
|
176 | foreach ($this->cmdOption as $v) { |
|
177 | // Single char param without '-' |
|
178 | if (1 == strlen($v)) { |
|
179 | $v = '-' . $v; |
|
180 | } elseif (1 < strlen($v) && '--' != substr($v, 0, 2)) { |
|
181 | // Multi char param without '--' |
|
182 | $v = '--' . $v; |
|
183 | } |
|
184 | ||
185 | $s .= $v . ' '; |
|
186 | } |
|
187 | ||
188 | return $s; |
|
189 | } |
|
190 | } |
|
191 | ||
192 | ||
193 | /** |