GetArg overloads

Synopses

Declared in <common/args.h>

Return string argument, or std::nullopt if it was not set.

[[requires_capability(0x7f2e381ad368)]]
std::optional<std::string>
GetArg(std::string const& strArg) const;

Return integer argument, or std::nullopt if it was not set.

template<std::integral Int>
[[requires_capability(0x7f2e381ad728)]]
std::optional<Int>
GetArg(std::string const& strArg) const;

Return string argument or default value

[[requires_capability(0x7f2e381ad228)]]
std::string
GetArg(
    std::string const& strArg,
    std::string const& strDefault) const;

Return integer argument or default value

template<std::integral Int>
[[requires_capability(0x7f2e381ad5e8)]]
Int
GetArg(
    std::string const& strArg,
    Int nDefault) const;

Return Value

  • The argument value, or std::nullopt if unset.

  • The integer value, or std::nullopt if unset.

  • command‐line argument or default value

  • command‐line argument (0 if invalid number) or default value

Parameters

Name

Description

strArg

Argument to get (e.g. "‐foo").

strDefault

(e.g. "1")

nDefault

(e.g. 1)

Created with MrDocs