xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-strings/Opts.td (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1include "llvm/Option/OptParser.td"
2
3class F<string letter, string help> : Flag<["-"], letter>, HelpText<help>;
4class FF<string name, string help> : Flag<["--"], name>, HelpText<help>;
5
6multiclass Eq<string name, string help> {
7  def NAME #_EQ : Joined<["--"], name #"=">,
8                  HelpText<help>;
9  def : Separate<["--"], name>, Alias<!cast<Joined>(NAME #_EQ)>;
10}
11
12def all : FF<"all", "Silently ignored. Present for GNU strings compatibility">;
13defm bytes : Eq<"bytes", "Print sequences of the specified length">;
14def help : FF<"help", "Display this help">;
15def print_file_name : Flag<["--"], "print-file-name">, HelpText<"Print the name of the file before each string">;
16defm radix : Eq<"radix", "Print the offset within the file with the specified radix: o (octal), d (decimal), x (hexadecimal)">, MetaVarName<"<radix>">;
17def version : FF<"version", "Display the version">;
18
19def : F<"a", "Alias for --all">, Alias<all>;
20def : F<"f", "Alias for --print-file-name">, Alias<print_file_name>;
21def : F<"h", "Alias for --help">, Alias<help>;
22def : JoinedOrSeparate<["-"], "n">, Alias<bytes_EQ>, HelpText<"Alias for --bytes">;
23def : JoinedOrSeparate<["-"], "t">, Alias<radix_EQ>, HelpText<"Alias for --radix">, MetaVarName<"<radix>">;
24