File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -489,9 +489,16 @@ public function parse()
489489 // todo protect against duplicates caused by aliases
490490 foreach ($ this ->options as $ option ) {
491491 if (is_null ($ option ->getValue ()) && $ option ->isRequired ()) {
492- throw new \Exception (sprintf ('Required %s %s must be specified ' ,
493- $ option ->getType () & Option::TYPE_NAMED ?
494- 'option ' : 'argument ' , $ option ->getName ()));
492+ $ name = $ option ->getName ();
493+ if ($ option ->getType () & Option::TYPE_NAMED ) {
494+ $ nature = 'option ' ;
495+ } else {
496+ $ nature = 'argument ' ;
497+ if ($ title = $ option ->getTitle ()) {
498+ $ name = $ title ;
499+ }
500+ }
501+ throw new \Exception (sprintf ('Required %s %s must be specified ' , $ nature , $ name ));
495502 }
496503 }
497504
Original file line number Diff line number Diff line change @@ -320,6 +320,14 @@ public function getAliases()
320320 return $ this ->aliases ;
321321 }
322322
323+ /**
324+ * @return string title of the option
325+ */
326+ public function getTitle ()
327+ {
328+ return $ this ->title ;
329+ }
330+
323331 /**
324332 * Get the current set of this option's requirements
325333 * @return string[] List of required options
You can’t perform that action at this time.
0 commit comments