@@ -220,25 +220,29 @@ public function writeHelpCommand($command = "") {
220
220
// write out the generic usage info
221
221
$ this ->writeLine ($ commandLongUC ." Command Options " ,true );
222
222
$ 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 );
225
224
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 ("" );
230
233
}
231
234
232
- $ this ->writeLine ("" );
233
235
$ this ->writeLine ("Help: " );
234
236
$ this ->writeLine (" " .$ commandHelp ,true );
235
- $ this ->writeLine (" Samples: " ,true );
236
237
237
238
// 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
+ }
242
246
}
243
247
244
248
}
0 commit comments