[libOption] - Add flag allowing to print options aliases in help text.
Needs ReviewPublic

Authored by grimar on Mon, Jul 17, 3:56 AM.

Details

Summary

Goint to use it in LLD.
In short this is PR30422, previously LLD did not show
aliases in help text. With this it is possible.

Diff Detail

grimar created this revision.Mon, Jul 17, 3:56 AM
ruiu added a comment.Mon, Jul 17, 3:45 PM

Please wait until we decide how we print out the lld options in the help message.

In D35476#812068, @ruiu wrote:

Please wait until we decide how we print out the lld options in the help message.

Ok. Going to rebase this after rL308293 though.

But just in case - the way we will choose for LLD (render all or some of aliases)
should not affect this patch (except if we choose possible way to ignore aliases
rendering at all, which I believe not an option).

Because this patch only implements aliases rendering, and hidden flags handling is
independent and already was implemented before this change.

grimar updated this revision to Diff 107061.Tue, Jul 18, 4:30 AM
  • Rebased.
grimar updated this revision to Diff 107870.Mon, Jul 24, 2:48 AM
grimar edited the summary of this revision. (Show Details)
  • Reimplemented.

ShowAliases flag allows to specify that alias should take HelpText from its
parent option. In that case we can have for example:

def auxiliary: S<"auxiliary">, HelpText<"Set DT_AUXILIARY field to the specified name">;
def alias_auxiliary: Separate<["-"], "f">, Alias<auxiliary>;

and show both options in help:

--auxiliary <value> Set DT_AUXILIARY field to the specified name
-f <value>              Set DT_AUXILIARY field to the specified name

Without that change we would render only first line in --help.

grimar updated this revision to Diff 107874.Mon, Jul 24, 2:57 AM
  • Change argument name, added lost description.
ruiu added a comment.Mon, Jul 24, 10:36 AM

The new behavior is probably fine, but I don't think you needed to change the parameter name.