1 include "llvm/Option/OptParser.td"
3 def OptFlag1 : OptionFlag;
4 def OptFlag2 : OptionFlag;
5 def OptFlag3 : OptionFlag;
7 def SubtoolVis : OptionVisibility;
8 def MultiLineVis: OptionVisibility;
10 def A : Flag<["-"], "A">, HelpText<"The A option">, Flags<[OptFlag1]>;
11 def AB : Flag<["-"], "AB">;
12 def B : Joined<["-"], "B">, HelpText<"The B option">, MetaVarName<"B">, Flags<[OptFlag2]>;
13 def C : Separate<["-"], "C">, HelpText<"The C option">, MetaVarName<"C">, Flags<[OptFlag1]>;
14 def SLASH_C : Separate<["/", "-"], "C">, HelpText<"The C option">, MetaVarName<"C">, Flags<[OptFlag3]>;
15 def D : CommaJoined<["-"], "D">, HelpText<"The D option">, MetaVarName<"D">;
16 def E : MultiArg<["-"], "E", 2>, Flags<[OptFlag1, OptFlag2]>;
17 def F : JoinedOrSeparate<["-"], "F">, HelpText<"The F option">, MetaVarName<"F">;
18 def G : JoinedAndSeparate<["-"], "G">, HelpText<"The G option">, MetaVarName<"G">;
20 def Ceq : Joined<["-", "--"], "C=">, Alias<C>, Flags<[OptFlag1]>;
22 def H : Flag<["-"], "H">, Flags<[HelpHidden]>;
24 def my_group : OptionGroup<"my group">;
25 def I : Flag<["-"], "I">, Alias<H>, Group<my_group>;
27 def J : Flag<["-"], "J">, Alias<B>, AliasArgs<["foo"]>;
28 def Joo : Flag<["-"], "Joo">, Alias<B>, AliasArgs<["bar"]>;
30 def K : Flag<["-"], "K">, Alias<B>;
32 def Slurp : Option<["-"], "slurp", KIND_REMAINING_ARGS>;
34 def SlurpJoined : Option<["-"], "slurpjoined", KIND_REMAINING_ARGS_JOINED>;
36 def Blorp : Flag<["-", "--"], "blorp">, HelpText<"The blorp option">, Flags<[OptFlag1]>;
37 def Blarn : Flag<["--", "-"], "blarn">, HelpText<"The blarn option">, Flags<[OptFlag1]>;
38 def Cramb : Joined<["/"], "cramb:">, HelpText<"The cramb option">, MetaVarName<"CRAMB">, Flags<[OptFlag1]>;
39 def Doopf1 : Flag<["-"], "doopf1">, HelpText<"The doopf1 option">, Flags<[OptFlag1]>;
40 def Doopf2 : Flag<["-"], "doopf2">, HelpText<"The doopf2 option">, Flags<[OptFlag2]>;
41 def Xyzzy1 : Flag<["-"], "xyzzy1">, HelpText<"The xyzzy1 option">, Visibility<[SubtoolVis]>;
42 def Xyzzy2 : Flag<["-"], "xyzzy2">, HelpText<"The xyzzy2 option">, Visibility<[DefaultVis]>;
43 def Ermgh : Joined<["--"], "ermgh">, HelpText<"The ermgh option">, MetaVarName<"ERMGH">, Flags<[OptFlag1]>;
44 def Fjormp : Flag<["--"], "fjormp">, HelpText<"The fjormp option">, Flags<[OptFlag1]>;
46 def Glorrmp_eq : Flag<["--"], "glorrmp=">;
48 def Blurmpq : Flag<["--"], "blurmp">;
49 def Blurmpq_eq : Flag<["--"], "blurmp=">;
51 def Q : Flag<["-"], "Q">, Visibility<[SubtoolVis]>;
52 def R : Flag<["-"], "R">, Visibility<[DefaultVis, SubtoolVis]>;
54 def multiline_help : Flag<["-"], "multiline-help">, HelpText<"This a help text that has\nmultiple lines in it">, Visibility<[MultiLineVis]>;
56 def multiline_help_long :
57 Flag<["-"], "multiline-help-with-long-name">,
58 HelpText<"This a help text that has\n"
59 "multiple lines in it\n"
61 Visibility<[MultiLineVis]>;
63 class XOpts<string base> : KeyPathAndMacro<"X->", base> {}
65 def marshalled_flag_d : Flag<["-"], "marshalled-flag-d">,
66 MarshallingInfoFlag<XOpts<"MarshalledFlagD">>;
67 def marshalled_flag_c : Flag<["-"], "marshalled-flag-c">,
68 MarshallingInfoFlag<XOpts<"MarshalledFlagC">>,
69 ImpliedByAnyOf<[marshalled_flag_d.KeyPath], "true">;
70 def marshalled_flag_b : Flag<["-"], "marshalled-flag-b">,
71 MarshallingInfoFlag<XOpts<"MarshalledFlagB">>,
72 ImpliedByAnyOf<[marshalled_flag_d.KeyPath], "true">;
73 def marshalled_flag_a : Flag<["-"], "marshalled-flag-a">,
74 MarshallingInfoFlag<XOpts<"MarshalledFlagA">>,
75 ImpliedByAnyOf<[marshalled_flag_c.KeyPath, marshalled_flag_b.KeyPath]>;