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