Lines Matching refs:to
7 long term goal is eventually for all `art` command-line tools to be using these helpers.
15 The `CmdlineParser` class provides a fluent interface using a domain-specific language to quickly
17 it can parse a string into a `VariantMap`, although in the future it might be desirable to parse
24 For example, to save the values into a user-defined variant map:
33 // See variant_map_test.cc for how to completely define a custom map.
80 The simplest kind of argument just tests for presence, but we often want to parse out a particular
82 _wildcard_ must be used to denote the location within the token that the type will be parsed out of.
84 For example with `-orange:_` the parse would know to check all tokens in an `argv` list for the
85 `-orange:` prefix and then strip it, leaving only the remains to be parsed.
88 After an argument definition is provided, the parser builder needs to know what type the argument
89 will be in order to provide the type safety and make sure the rest of the argument definition is
93 Everything that follows a `WithType<T>()` call is thus type checked to only take `T` values.
99 Some values will not make sense outside of a `[min, max]` range, so this is an option to quickly add
104 When parsing an enumeration, it might be very convenient to map a list of possible argument string
114 `-hello:whatever`), converting it to the type-safe value of `kWorld` or `kGalaxy` respectively.
116 This is meant to be another shorthand (like `WithRange`) to avoid writing a custom type parser. In
120 When an argument definition has multiple aliases with no wildcards, it might be convenient to
130 In general, it uses the position of the argument alias to map into the WithValues position value.
133 no way to position-ally match that).
136 By default, the argument is assumed to appear exactly once, and if the user specifies it more than
140 In some situations, we may want to accumulate the argument values instead of discarding the previous
153 To complete an argument definition, the parser generator also needs to know where to save values.
171 an option to ignore any argument tokens that are not known to the parser. This is done with the
174 It's semantically equivalent to making a series of argument definitions that map to `Unit` but don't
180 static interface provided by `CmdlineTypeParser`. It is recommended to inherit from
184 `std::vector<std::string>` and are meant to be used with `AppendValues` in which case the
197 return Result::Failure("Failed to parse double from " + str);
201 "Failed to parse double from " + str + "; overflow/underflow occurred");
228 be default-constructed to `T{}` for the first occurrence of the argument).
231 `Result` is a typedef for `CmdlineParseResult<T>` and it acts similar to a poor version of
232 `Either<Left, Right>` in Haskell. In particular, it would be similar to `Either< int ErrorCode,
235 There are helpers like `Result::Success(value)`, `Result::Failure(string message)` and so on to
242 When many arguments are parsed, the result is collapsed down to a `CmdlineResult` which acts as a