1 include "llvm/Option/OptParser.td"
3 def OptFlag1 : OptionFlag;
4 def OptFlag2 : OptionFlag;
5 def OptFlag3 : OptionFlag;
7 def SubtoolVis : OptionVisibility;
9 def A : Flag<["-"], "A">, HelpText<"The A option">, Flags<[OptFlag1]>;
10 def AB : Flag<["-"], "AB">;
11 def B : Joined<["-"], "B">, HelpText<"The B option">, MetaVarName<"B">, Flags<[OptFlag2]>;
12 def C : Separate<["-"], "C">, HelpText<"The C option">, MetaVarName<"C">, Flags<[OptFlag1]>;
13 def SLASH_C : Separate<["/", "-"], "C">, HelpText<"The C option">, MetaVarName<"C">, Flags<[OptFlag3]>;
14 def D : CommaJoined<["-"], "D">, HelpText<"The D option">, MetaVarName<"D">;
15 def E : MultiArg<["-"], "E", 2>, Flags<[OptFlag1, OptFlag2]>;
16 def F : JoinedOrSeparate<["-"], "F">, HelpText<"The F option">, MetaVarName<"F">;
17 def G : JoinedAndSeparate<["-"], "G">, HelpText<"The G option">, MetaVarName<"G">;
19 def Ceq : Joined<["-", "--"], "C=">, Alias<C>, Flags<[OptFlag1]>;
21 def H : Flag<["-"], "H">, Flags<[HelpHidden]>;
23 def my_group : OptionGroup<"my group">;
24 def I : Flag<["-"], "I">, Alias<H>, Group<my_group>;
26 def J : Flag<["-"], "J">, Alias<B>, AliasArgs<["foo"]>;
27 def Joo : Flag<["-"], "Joo">, Alias<B>, AliasArgs<["bar"]>;
29 def K : Flag<["-"], "K">, Alias<B>;
31 def Slurp : Option<["-"], "slurp", KIND_REMAINING_ARGS>;
33 def SlurpJoined : Option<["-"], "slurpjoined", KIND_REMAINING_ARGS_JOINED>;
35 def Blorp : Flag<["-", "--"], "blorp">, HelpText<"The blorp option">, Flags<[OptFlag1]>;
36 def Blarn : Flag<["--", "-"], "blarn">, HelpText<"The blarn option">, Flags<[OptFlag1]>;
37 def Cramb : Joined<["/"], "cramb:">, HelpText<"The cramb option">, MetaVarName<"CRAMB">, Flags<[OptFlag1]>;
38 def Doopf1 : Flag<["-"], "doopf1">, HelpText<"The doopf1 option">, Flags<[OptFlag1]>;
39 def Doopf2 : Flag<["-"], "doopf2">, HelpText<"The doopf2 option">, Flags<[OptFlag2]>;
40 def Xyzzy1 : Flag<["-"], "xyzzy1">, HelpText<"The xyzzy1 option">, Visibility<[SubtoolVis]>;
41 def Xyzzy2 : Flag<["-"], "xyzzy2">, HelpText<"The xyzzy2 option">, Visibility<[DefaultVis]>;
42 def Ermgh : Joined<["--"], "ermgh">, HelpText<"The ermgh option">, MetaVarName<"ERMGH">, Flags<[OptFlag1]>;
43 def Fjormp : Flag<["--"], "fjormp">, HelpText<"The fjormp option">, Flags<[OptFlag1]>;
45 def Glorrmp_eq : Flag<["--"], "glorrmp=">;
47 def Blurmpq : Flag<["--"], "blurmp">;
48 def Blurmpq_eq : Flag<["--"], "blurmp=">;
50 def Q : Flag<["-"], "Q">, Visibility<[SubtoolVis]>;
51 def R : Flag<["-"], "R">, Visibility<[DefaultVis, SubtoolVis]>;
53 class XOpts<string base> : KeyPathAndMacro<"X->", base> {}
55 def marshalled_flag_d : Flag<["-"], "marshalled-flag-d">,
56 MarshallingInfoFlag<XOpts<"MarshalledFlagD">>;
57 def marshalled_flag_c : Flag<["-"], "marshalled-flag-c">,
58 MarshallingInfoFlag<XOpts<"MarshalledFlagC">>,
59 ImpliedByAnyOf<[marshalled_flag_d.KeyPath], "true">;
60 def marshalled_flag_b : Flag<["-"], "marshalled-flag-b">,
61 MarshallingInfoFlag<XOpts<"MarshalledFlagB">>,
62 ImpliedByAnyOf<[marshalled_flag_d.KeyPath], "true">;
63 def marshalled_flag_a : Flag<["-"], "marshalled-flag-a">,
64 MarshallingInfoFlag<XOpts<"MarshalledFlagA">>,
65 ImpliedByAnyOf<[marshalled_flag_c.KeyPath, marshalled_flag_b.KeyPath]>;