MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addSwitch

Method addSwitch

source/core/StarOptionParser.cpp:18–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void OptionParser::addSwitch(String const& flag, String description) {
19 if (!m_options.insert(flag, Switch{flag, std::move(description)}).second)
20 throw OptionParserException::format("Duplicate switch '-{}' added", flag);
21}
22
23void OptionParser::addParameter(String const& flag, String argument, RequirementMode requirementMode, String description) {
24 if (!m_options.insert(flag, Parameter{flag, std::move(argument), requirementMode, std::move(description)}).second)

Callers 3

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

formatFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected