Sharg 1.1.0
The argument parser for bio-c++ tools.
 
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// --------------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2023, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2023, Knut Reinert & MPI für molekulare Genetik
4// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5// shipped with this file and also available at: https://github.com/seqan/sharg-parser/blob/main/LICENSE.md
6// --------------------------------------------------------------------------------------------------------
7
13#pragma once
14
15#include <sharg/validators.hpp>
16
17namespace sharg
18{
19
44template <typename validator_t = detail::default_validator>
45struct config
46{
47 static_assert(sharg::validator<validator_t>, "The validator passed to sharg::config must model sharg::validator");
48
56 char short_id{'\0'};
57
66
72
91
108 bool advanced{false};
109
120 bool hidden{false};
121
132 bool required{false};
133
138 validator_t validator{};
139};
140
141} // namespace sharg
The concept for option validators passed to add_option/positional_option.
Definition: validators.hpp:50
Option struct that is passed to the sharg::parser::add_option() function.
Definition: config.hpp:46
std::string description
The description to be shown on any (exported) help page.
Definition: config.hpp:71
std::string long_id
The long identifier for the option (e.g. "age", making the option callable via --age).
Definition: config.hpp:65
bool hidden
Whether the option should be hidden.
Definition: config.hpp:120
bool advanced
Whether the option should only be displayed on the advanced help page.
Definition: config.hpp:108
bool required
Whether the option is required.
Definition: config.hpp:132
char short_id
The short identifier for the option (e.g. 'a', making the option callable via -a).
Definition: config.hpp:56
std::string default_message
The default message to be shown on any (exported) help page.
Definition: config.hpp:90
Provides some standard validators for (positional) options.