einsums::cl::Flag#

Note

Generated from the C++ headers by apiary --emit-cpp-docs-json.

Defined in header Einsums/Options/Declare.hpp.

class Flag : public OptionBase#

A boolean option whose meaning is carried by its presence.

–verbose sets it, –verbose=false clears it. ImplicitValue(false) inverts presence, which is how the generated no- flags work. See Flag::parse_token for other sources.

template<typename ...Args>
Flag(std::string_view longName, std::initializer_list<char> shorts, std::string_view helpText, Args&&... args)#
template<typename F>
requires SetterCallable<F, bool>
Flag &OnSet(F &&f)#
void finalize_default() override#
bool parse_token(std::string_view, std::optional<std::string_view> val, std::string &error, Source src) override#

Apply a flag from any source.

From a config file or the environment, a truthy value applies the flag as if named on the command line and a falsey one leaves the default: EINSUMS_DEBUG_NO_ATTACH_DEBUGGER=1 means “do not attach”.

HelpEntry help_entry() const override#
bool get() const#
bool value#
bool *bound#
std::function<void(const bool&, Source)> setter#
bool implicit_on#
bool has_implicit_override#
bool set_on_unseen#
bool default_value#

The declared default, kept apart from value so that help text reports what the option defaults to rather than what it currently holds.

std::string extra_annotation#

An extra –help note; a generated pair uses it to mention its hidden –no- twin.