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