@@ -220,25 +220,29 @@ public function writeHelpCommand($command = "") {
220220 // write out the generic usage info
221221 $ this ->writeLine ($ commandLongUC ." Command Options " ,true );
222222 $ this ->writeLine ("Usage: " );
223- $ this ->writeLine (" php " .$ this ->self ." -- " .$ commandLong ." " .$ optionList ,true );
224- $ this ->writeLine ("Available options: " );
223+ $ this ->writeLine (" php " .$ this ->self ." -- " .$ commandLong ."|- " .$ commandShort ." " .$ optionList ,true );
225224
226- // write out the options
227- foreach ($ commandOptions as $ option => $ attributes ) {
228- $ spacer = $ this ->getSpacer ($ lengthLong ,$ attributes ["optionLongLength " ]);
229- $ this ->writeLine (" -- " .$ attributes ["optionLong " ].$ spacer ."(- " .$ attributes ["optionShort " ].") " .$ attributes ["optionDesc " ]);
225+ // write out the available options
226+ if (count ($ commandOptions ) > 0 ) {
227+ $ this ->writeLine ("Available options: " );
228+ foreach ($ commandOptions as $ option => $ attributes ) {
229+ $ spacer = $ this ->getSpacer ($ lengthLong ,$ attributes ["optionLongLength " ]);
230+ $ this ->writeLine (" -- " .$ attributes ["optionLong " ].$ spacer ."(- " .$ attributes ["optionShort " ].") " .$ attributes ["optionDesc " ]);
231+ }
232+ $ this ->writeLine ("" );
230233 }
231234
232- $ this ->writeLine ("" );
233235 $ this ->writeLine ("Help: " );
234236 $ this ->writeLine (" " .$ commandHelp ,true );
235- $ this ->writeLine (" Samples: " ,true );
236237
237238 // write out the samples
238- foreach ($ commandOptions as $ option => $ attributes ) {
239- $ this ->writeLine (" " .$ attributes ["optionSample " ]);
240- $ this ->writeLine (" php " .$ this ->self ." -- " .$ commandLong ." -- " .$ attributes ["optionLong " ]);
241- $ this ->writeLine (" php " .$ this ->self ." - " .$ commandShort ." - " .$ attributes ["optionShort " ],true );
239+ if (count ($ commandOptions ) > 0 ) {
240+ $ this ->writeLine (" Samples: " ,true );
241+ foreach ($ commandOptions as $ option => $ attributes ) {
242+ $ this ->writeLine (" " .$ attributes ["optionSample " ]);
243+ $ this ->writeLine (" php " .$ this ->self ." -- " .$ commandLong ." -- " .$ attributes ["optionLong " ]);
244+ $ this ->writeLine (" php " .$ this ->self ." - " .$ commandShort ." - " .$ attributes ["optionShort " ],true );
245+ }
242246 }
243247
244248 }
0 commit comments