Sharg 1.1.2-rc.1
The argument parser for bio-c++ tools.
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024, Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024, Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <sharg/validators.hpp>
13
14namespace sharg
15{
16
41template <typename validator_t = detail::default_validator>
42struct config
43{
44 static_assert(sharg::validator<validator_t>, "The validator passed to sharg::config must model sharg::validator");
45
53 char short_id{'\0'};
54
63
69
88
105 bool advanced{false};
106
117 bool hidden{false};
118
129 bool required{false};
130
135 validator_t validator{};
136};
137
138} // namespace sharg
The concept for option validators passed to add_option/positional_option.
Definition validators.hpp:49
Option struct that is passed to the sharg::parser::add_option() function.
Definition config.hpp:43
std::string description
The description to be shown on any (exported) help page.
Definition config.hpp:68
std::string long_id
The long identifier for the option (e.g. "age", making the option callable via --age).
Definition config.hpp:62
bool hidden
Whether the option should be hidden.
Definition config.hpp:117
bool advanced
Whether the option should only be displayed on the advanced help page.
Definition config.hpp:105
bool required
Whether the option is required.
Definition config.hpp:129
char short_id
The short identifier for the option (e.g. 'a', making the option callable via -a).
Definition config.hpp:53
std::string default_message
The default message to be shown on any (exported) help page.
Definition config.hpp:87
Provides some standard validators for (positional) options.
Hide me