| 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; |