File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -334,20 +334,35 @@ protected function renderHelpView(Command $command)
334334 $ paramsHelp = '' ;
335335 $ argumentsHelp = '' ;
336336
337+ if (count ($ command ->getHelp ()['arguments ' ]) === 0 ) {
338+ $ argumentsHelp = " This command has no arguments. \n" ;
339+ }
340+
337341 foreach ($ command ->getHelp ()['arguments ' ] as $ helpKey => $ helpValue ) {
338342 $ argumentsHelp .= " $ helpKey: {$ helpValue ['description ' ]}\n" ;
339343 }
340344
341345 foreach ($ command ->getHelp ()['params ' ] as $ helpKey => $ helpValue ) {
342- $ paramsHelp .= " $ helpKey: {$ helpValue ['description ' ]}\n" ;
346+ $ paramsHelp .= (($ helpValue ['short ' ] !== null ) ? " - {$ helpValue ['short ' ]}, " : ' ' ) .
347+ " -- {$ helpValue ['long ' ]}: {$ helpValue ['description ' ]}\n" ;
348+ }
349+
350+ $ options = $ command ->getHelp ();
351+ $ arguments = $ options ['arguments ' ];
352+ $ params = count ($ options ['params ' ]) > 0 ? '[--options...] ' : '' ;
353+
354+ $ usageArguments = '' ;
355+
356+ foreach ($ arguments as $ argKey => $ argValue ) {
357+ $ usageArguments .= " [ $ argKey] " ;
343358 }
344359
345360 echo <<<HELP
346361Description:
347362 {$ command ->getDescription ()}
348363
349364Usage:
350- {$ command ->getName ()} [options] [--] [<packages>...]
365+ {$ command ->getName ()}{ $ usageArguments } { $ params }
351366
352367Arguments:
353368$ argumentsHelp
You can’t perform that action at this time.
0 commit comments