Lines Matching defs:flag

28 //  - Currently supported flag types: BOOLEAN, STRING
32 // Example: binary -g -- -g --some-other-flag
33 // - the first `-g` is a flag.
34 // - the second `-g` is not a flag.
35 // - `--some-other-flag` is not a flag.
40 // --my-flag : allowed, sets --my-flag to true.
41 // --my-flag=true : allowed, sets --my-flag to true.
42 // --my-flag true : NOT allowed.
44 // --my-flag=TRUE : NOT allowed.
53 // flag name: `output`
54 // flag value: `-file.spv`
56 // - This implementation generates flag at compile time. Meaning flag names
60 // // Declaring a long-form flag.
64 // -> command-line: --my-flag
70 // - This is only done when parsing a long-form flag name.
79 // // Defines a '-h' boolean flag for help printing, optional.
81 // // Defines a '--my-flag' string flag, required.
82 // FLAG_LONG_string(my_flag, /*default=*/ "", "A magic flag!", true);
90 // printf("usage: my-bin --my-flag=<value>\n");
94 // printf("flag value: %s\n", flags::my_flag.value().c_str());
104 // - Underscores in the flag variable name are replaced with hyphens ('-').
109 // - command line: --my-flag=true
143 // Defines the static variable holding the flag, allowing access like
145 // By creating the FlagRegistration object, the flag can be added to
169 // Just a wrapper around the flag value.
184 // To add support for new flag-types, this needs to be extended, and the visitor
200 : flag(std::move(flag_)),
205 FlagType flag;
213 static void register_flag(Flag<T>& flag, std::string&& name, bool required,
215 get_flags().emplace_back(flag, std::move(name), required, is_short);
243 FlagRegistration(Flag<T>& flag, std::string&& name, bool required,
252 FlagList::register_flag(flag, std::move(fixed_name), required, is_short);