diff options
author | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2021-08-05 11:42:30 +0000 |
---|---|---|
committer | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2021-08-19 09:30:15 +0000 |
commit | dcc6b7b1d5e5a0f9537ce1bf919ac2338bd7ad7b (patch) | |
tree | ed2da2f046028b53b2d9daf6c7dce23bfae042dd /llvm/tools/llvm-cvtres | |
parent | cc3affd8b02091bf475f9dd083802e1b6a232be1 (diff) | |
download | llvm-dcc6b7b1d5e5a0f9537ce1bf919ac2338bd7ad7b.zip llvm-dcc6b7b1d5e5a0f9537ce1bf919ac2338bd7ad7b.tar.gz llvm-dcc6b7b1d5e5a0f9537ce1bf919ac2338bd7ad7b.tar.bz2 |
[OptTable] Refine how `printHelp` treats empty help texts
Currently, `printHelp` behaves differently for options that:
* do not define `HelpText` (such options _are not printed_), and
* define its `HelpText` as `HelpText<"">` (such options _are printed_).
In practice, both approaches lead to no help text and `printHelp` should
treat them consistently. This patch addresses that by making
`printHelpt` check the length of the help text to be printed.
All affected tests have been updated accordingly. The option definitions
for llvm-cvtres have been updated with a short description or "Not
implemented" for options that are ignored by the tool.
Differential Revision: https://reviews.llvm.org/D107557
Diffstat (limited to 'llvm/tools/llvm-cvtres')
-rw-r--r-- | llvm/tools/llvm-cvtres/Opts.td | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/tools/llvm-cvtres/Opts.td b/llvm/tools/llvm-cvtres/Opts.td index 8687d47..21d5837 100644 --- a/llvm/tools/llvm-cvtres/Opts.td +++ b/llvm/tools/llvm-cvtres/Opts.td @@ -2,14 +2,14 @@ include "llvm/Option/OptParser.td" // All the switches can be preceded by either '/' or '-'. -def DEFINE : Joined<["/", "-"], "DEFINE:">, HelpText<"">, MetaVarName<"symbol">; -def FOLDDUPS : Flag<["/", "-"], "FOLDDUPS:">, HelpText<"">; -def MACHINE : Joined<["/", "-"], "MACHINE:">, HelpText<"">, MetaVarName<"{ARM|ARM64|EBC|IA64|X64|X86}">; -def NOLOGO : Flag<["/", "-"], "NOLOGO">, HelpText<"">; -def OUT : Joined<["/", "-"], "OUT:">, HelpText<"">, MetaVarName<"filename">; -def READONLY : Flag<["/", "-"], "READONLY">, HelpText<"">; -def VERBOSE : Flag<["/", "-"], "VERBOSE">, HelpText<"">; -def HELP : Flag<["/", "-"], "HELP">; +def DEFINE : Joined<["/", "-"], "DEFINE:">, HelpText<"Not implemented">, MetaVarName<"symbol">; +def FOLDDUPS : Flag<["/", "-"], "FOLDDUPS:">, HelpText<"Not implemented">; +def MACHINE : Joined<["/", "-"], "MACHINE:">, HelpText<"Machine architecture">, MetaVarName<"{ARM|ARM64|EBC|IA64|X64|X86}">; +def NOLOGO : Flag<["/", "-"], "NOLOGO">, HelpText<"Not implemented">; +def OUT : Joined<["/", "-"], "OUT:">, HelpText<"Output file">, MetaVarName<"filename">; +def READONLY : Flag<["/", "-"], "READONLY">, HelpText<"Not implemented">; +def VERBOSE : Flag<["/", "-"], "VERBOSE">, HelpText<"Use verbose output">; +def HELP : Flag<["/", "-"], "HELP">, HelpText<"Display available options">; def H : Flag<["/", "-"], "H">, Alias<HELP>; def HELP_Q : Flag<["/?", "-?"], "">, Alias<HELP>; |