MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / Option

Method Option

docopt_private.h:243–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 static Option parse(std::string const& option_description);
242
243 Option(std::string shortOption,
244 std::string longOption,
245 int argcount = 0,
246 value v = value{false})
247 : LeafPattern(longOption.empty() ? shortOption : longOption,
248 std::move(v)),
249 fShortOption(std::move(shortOption)),
250 fLongOption(std::move(longOption)),
251 fArgcount(argcount)
252 {
253 // From Python:
254 // self.value = None if value is False and argcount else value
255 if (argcount && v.isBool() && !v.asBool()) {
256 setValue(value{});
257 }
258 }
259
260 Option(Option const&) = default;
261 Option(Option&&) = default;

Callers

nothing calls this directly

Calls 2

isBoolMethod · 0.80
asBoolMethod · 0.80

Tested by

no test coverage detected