clipp.h
Go to the documentation of this file.
83 {}
89 {}
201 {};
225 std::true_type{});
304 }
340 };
391 };
514 }
518 };
536 }
540 };
588 T* t_;
608 };
628 };
675 }
693 );
827 static_assert(std::is_same<string_t,
1190 argActions_.push_back(simple_action_adapter(std::move(a)));
1232 Derived&
1252 Derived&
1315 !std::is_fundamental<typename std::decay<T>::type>() &&
1328 std::is_fundamental<typename std::decay<T>::type>() ||
1373 p.target(std::forward<Target>(t));
1409 std::vector<index_action> missingActions_;
1442 }
1461 }
1474 }
1502 {
1517 {
1539 {
1629 decpoint_{decimalPoint}, separator_{digitSeparator},
1641 };
1662 };
1704 }
1708 };
1729 };
1750 };
1964 }
1978 }
2654 {
2661 {}
2665 };
2683 }
2701 }
2763 }
2798 }
2838 stack_.erase(i.base(), stack_.end());
2877 }
2925 }
3103 children_.emplace_back(std::move(v));
3110 children_.emplace_back(g);
3117 children_.emplace_back(std::move(g));
3146 children_.emplace(children_.begin(), std::move(v));
3153 children_.emplace(children_.begin(), g);
3160 children_.emplace(children_.begin(), std::move(g));
3222 }
3369 {
3425 {
3557 {
3564 {
3571 {
3641 {
3648 }
3798 {
4026 };
4031 }
4056 };
4186 index_{idx}, arg_{std::move(s)}, match_{match},
4219 }
4225 std::size_t repeat_;
4259 pos{std::move(p)}, index{idx},
4260 startsRepeatGroup{firstInRepeatGroup}
4284 });
4749 arg2param_{std::move(arg2param)}, missing_{std::move(misses)}
4750 {}
4756 arg_mappings::size_type
5031 return str::has_prefix(flag, prefix_);
5083 }
5088 paramSep_ = sep;
5095 groupSep_ = sep;
5102 altParamSep_ = sep;
5109 altGroupSep_ = sep;
5116 flagSep_ = sep;
5127 }
5137 }
5147 }
5157 }
5167 }
5177 }
5187 }
5196 }
5221 }
5315 params_(params), fmt_(fmt), prefix_(std::move(prefix))
5337 }
5780 :
5805 }
6011 {
6012 sections_.emplace_back(std::move(title), std::move(content));
6018 {
6045 }
6086 }
6137 {
6144 }
6218 }
const group & parent() const noexcept
Definition: clipp.h:3772
friend OStream & operator<<(OStream &os, const usage_lines &p)
Definition: clipp.h:5342
subrange first_integer_match(std::basic_string< C, T, A > s, C digitSeparator=C(','))
returns first substring match (pos,len) that represents an integer (with optional digit separators)
Definition: clipp.h:977
static unsigned long int from(const char *s)
Definition: clipp.h:376
group()=default
bool joinable() const noexcept
returns if a command line argument can be matched by a combination of (partial) matches through any n...
Definition: clipp.h:2992
bool exclusive() const noexcept
returns if children are mutually exclusive alternatives
Definition: clipp.h:3023
parameter opt_values(const doc_string &label, Targets &&... tgts)
makes optional, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2184
group & scoped(bool yes)
turns explicit scoping on or off operators , & | and other combinating functions will not merge group...
Definition: clipp.h:3002
parameter opt_word(const doc_string &label, Targets &&... tgts)
makes optional, blocking value parameter; matches any string consisting of alphanumeric characters
Definition: clipp.h:2250
friend parameter & with_prefixes_short_long(const arg_string &shortpfx, const arg_string &longpfx, parameter &p)
prepend prefix to each flag
Definition: clipp.h:1992
group::depth_first_traverser dfs_traverser
Definition: clipp.h:3758
context()=default
constexpr assign_value(T &target, X &&value) noexcept
Definition: clipp.h:470
constexpr size_type at() const noexcept
position of the match within the subject string
Definition: clipp.h:100
subrange longest_prefix_match(const std::basic_string< C, T, A > &arg, const InputRange &prefixes)
returns longest prefix range that could be found in 'arg'
Definition: clipp.h:863
const string & repeat_postfix() const noexcept
Definition: clipp.h:5157
const string & group_prefix() const noexcept
Definition: clipp.h:5186
parameter && with_prefix(const arg_string &prefix, parameter &&p)
recursively prepends a prefix to all flags
Definition: clipp.h:3641
const string & alternative_flags_prefix() const noexcept
Definition: clipp.h:5176
const match_function & matcher() const noexcept
access custom match operation
Definition: clipp.h:1970
T clamped_on_limits(const V &v)
returns value of v as a T, clamped at T's maximum
Definition: clipp.h:327
child & operator[](size_type index) noexcept
indexed, nutable access to child
Definition: clipp.h:3197
constexpr auto check_has_size_getter(int) -> decltype(std::declval< T >().size(), std::true_type
size() member type trait
Definition: clipp.h:253
group one_of(Param param, Params... params)
makes a group of alternative parameters or groups
Definition: clipp.h:3413
Definition: clipp.h:242
parameter value(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2094
const arg_mappings & args() const
returns range of argument -> parameter mappings
Definition: clipp.h:4322
man_page & append_section(string title, string content)
Definition: clipp.h:6018
detail::scoped_dfs_traverser scoped_dfs_traverser
Definition: clipp.h:4180
auto longest_common_prefix(const InputRange &strs) -> typename std::decay< decltype(*begin(strs))>::type
returns longest common prefix of several sequential random access containers
Definition: clipp.h:780
group of parameters and/or other groups; can be configured to act as a group of alternatives (exclusi...
Definition: clipp.h:2447
const string & repeat_prefix() const noexcept
Definition: clipp.h:5156
group operator|(parameter a, parameter b)
makes a group of alternative parameters or groups
Definition: clipp.h:3425
bool alphabetic(const arg_string &s)
predicate that returns true if the argument is a non-empty string that consists only of alphabetic ch...
Definition: clipp.h:1616
const string & alternative_group_separator() const noexcept
Definition: clipp.h:5120
@ no
const child & operator*() const noexcept
Definition: clipp.h:2781
bool is_repeatable(int minlevel=0) const noexcept
repeatable or inside a repeatable group >= minlevel
Definition: clipp.h:2732
iterator end() const noexcept
returns non-mutating iterator to position one past the last argument -> parameter mapping
Definition: clipp.h:4811
bool empty() const noexcept
returns true, if group has no children, false otherwise
Definition: clipp.h:3219
match_t prefix_match(scoped_dfs_traverser pos, const arg_string &arg, const Predicate &select)
finds the first parameter that matches any (non-empty) prefix of a given string; candidate parameters...
Definition: clipp.h:4107
const string & label_prefix() const noexcept
Definition: clipp.h:5136
bool represents_number(const std::basic_string< C, T, A > &candidate, C digitSeparator=C(','), C decimalPoint=C('.'), C exponential=C('e'))
returns true if candidate string represents a number
Definition: clipp.h:1014
static unsigned long long int from(const char *s)
Definition: clipp.h:384
bool is_last_in_group() const noexcept
Definition: clipp.h:2706
predicate that returns the first substring match within the input string that rmeepresents a number (...
Definition: clipp.h:1630
subrange operator()(const arg_string &s) const
Definition: clipp.h:1710
const pattern * operator->() const noexcept
Definition: clipp.h:3776
T & operator%(doc_string docstr, token< T > &p)
sets documentation strings on a token
Definition: clipp.h:1502
bool flags_are_prefix_free() const
returns true, if no flag occurs as true prefix of any other flag (identical flags will be ignored)
Definition: clipp.h:3283
detail::assign_value< T, V > set(T &target, V value)
makes function object with a const char* parameter that assigns a value to a ref-captured object
Definition: clipp.h:1055
match_t()=default
arg_index after_index() const noexcept
Definition: clipp.h:4251
depth_first_traverser & back_to_parent()
Definition: clipp.h:2855
const_iterator cend() const noexcept
returns non-mutating iterator to position one past the last element
Definition: clipp.h:3248
usage_lines & ommit_outermost_group_surrounders(bool yes)
Definition: clipp.h:5333
subrange longest_substring_match(const std::basic_string< C, T, A > &arg, const InputRange &substrings)
returns longest substring range that could be found in 'arg'
Definition: clipp.h:827
Derived & if_blocked(simple_action a)
adds an action that will be called if a parameter was matched, but was unreachable in the current sco...
Definition: clipp.h:1272
mixin that provides basic common settings of parameters and groups
Definition: clipp.h:1434
parameter values(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2124
Derived & if_repeated(simple_action a)
adds an action that will be called if a parameter matches an argument for the 2nd,...
Definition: clipp.h:1232
bool operator()(const parameter &) const noexcept
Definition: clipp.h:4031
man_page make_man_page(const group ¶ms, doc_string progname="", const doc_formatting &fmt=doc_formatting{})
generates man sections from command line parameters with sections "synopsis" and "options"
Definition: clipp.h:6086
bool merge_joinable_with_common_prefix() const noexcept
Definition: clipp.h:5248
doc_formatting & max_flags_per_param_in_doc(int max)
determines maximum number of flags per parameter to be printed in detailed parameter documentation li...
Definition: clipp.h:5201
int max_flags_per_param_in_doc() const noexcept
Definition: clipp.h:5205
Definition: clipp.h:4036
scoped_dfs_traverser & operator++()
Definition: clipp.h:3805
friend Derived & operator<<(Target &&t, Derived &p)
adds target, see member function 'target'
Definition: clipp.h:1357
const string & optional_prefix() const noexcept
Definition: clipp.h:5146
const pattern * ptr() const noexcept
Definition: clipp.h:3779
doc_formatting & start_column(int col)
determines column where documentation printing starts
Definition: clipp.h:5074
parameter opt_numbers(const doc_string &label, Targets &&... tgts)
makes optional, blocking, repeatable value parameter; matches any string that represents a number
Definition: clipp.h:2340
const string & alternative_flags_postfix() const noexcept
Definition: clipp.h:5177
void next_after_match(scoped_dfs_traverser match)
Definition: clipp.h:3845
constexpr auto check_is_input_range(int) -> decltype(begin(std::declval< T >()), end(std::declval< T >()), std::true_type
input range type trait
Definition: clipp.h:225
constexpr auto check_is_callable_without_arg(int) -> decltype(std::declval< Fn >()(), std::integral_constant< bool, std::is_same< Ret, typename std::result_of< Fn()>::type >::value >
Definition: clipp.h:160
constexpr map_arg_to(T &target) noexcept
Definition: clipp.h:588
DFS traverser that keeps track of 'scopes' scope = all parameters that are either bounded by two bloc...
Definition: clipp.h:3756
bool any_bad_repeat() const noexcept
returns if any parameter matched repeatedly although it was not allowed to
Definition: clipp.h:4787
constexpr auto check_is_callable(int) -> decltype(std::declval< Fn >()(std::declval< Args >()...), std::integral_constant< bool, std::is_same< Ret, typename std::result_of< Fn(Args...)>::type >::value >
function (class) signature type trait
Definition: clipp.h:149
const context_list & stack() const
Definition: clipp.h:2748
const section & operator[](size_type index) const noexcept
Definition: clipp.h:6034
group in_sequence(Param param, Params... params)
makes a parameter/group sequence by making all input objects blocking
Definition: clipp.h:3484
predicate that returns true if the input string does not start with a given prefix
Definition: clipp.h:1747
Derived & call(arg_action a)
adds an action that has an operator() that is callable with a 'const char*' argument
Definition: clipp.h:1190
parameter integers(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any string that represents an integer
Definition: clipp.h:2376
group & joinable(group ¶m)
makes a group of parameters and/or groups where all single char flag params ("-a",...
Definition: clipp.h:3552
bool all_flagless() const
returns if all children are value parameters (recursive)
Definition: clipp.h:3091
const string & param_separator() const noexcept
Definition: clipp.h:5099
bool any_error() const noexcept
returns true if any parsing error / violation of the command line interface definition occured
Definition: clipp.h:4794
parameter option(String &&flag, Strings &&... flags)
makes optional, non-blocking exact match parameter
Definition: clipp.h:2078
numbers(char decimalPoint='.', char digitSeparator=' ', char exponentSeparator='e')
Definition: clipp.h:1633
void trim(std::basic_string< C, T, A > &s)
removes leading and trailing whitespace from string
Definition: clipp.h:712
depth_first_traverser & skip_alternatives()
skips all other alternatives in surrounding exclusive groups on next ++ note: renders alternatives un...
Definition: clipp.h:2877
bool has_prefix(const std::basic_string< C, T, A > &subject, const std::basic_string< C, T, A > &prefix)
returns true, if the 'prefix' argument is a prefix of the 'subject' argument
Definition: clipp.h:744
friend OStream & operator<<(OStream &os, const documentation &p)
Definition: clipp.h:5805
const_iterator cbegin() const noexcept
returns non-mutating iterator to position of first element
Definition: clipp.h:3241
Definition: clipp.h:192
scoped_dfs_traverser & next_sibling()
Definition: clipp.h:3795
detail::increment< T > increment(T &target)
makes function object that increments using operator ++
Definition: clipp.h:1119
parser(const group &root, arg_index offset=0)
initializes parser with a command line interface
Definition: clipp.h:4284
const string & empty_label() const noexcept
Definition: clipp.h:5092
arg_string common_flag_prefix() const
Definition: clipp.h:3784
bool operator()(const arg_string &s) const
Definition: clipp.h:1752
doc_formatting & surround_optional(const string &prefix, const string &postfix)
determnines strings surrounding optional parameters/groups
Definition: clipp.h:5141
const doc_string & label() const
returns parameter label; will be used for documentation, if flags are empty
Definition: clipp.h:1917
predicate that returns true if the input string represents an integer (with optional digit separators...
Definition: clipp.h:1659
depth_first_traverser begin_dfs() const noexcept
returns augmented iterator for depth first searches
Definition: clipp.h:3256
void triml(std::basic_string< C, T, A > &s)
removes leading whitespace from string
Definition: clipp.h:693
OStream & operator<<(OStream &os, const man_page &man)
generates man page based on command line parameters
Definition: clipp.h:6105
int paragraph_spacing() const noexcept
Definition: clipp.h:5230
depth_first_traverser & next_alternative()
skips to next alternative in innermost group
Definition: clipp.h:2838
subrange match(const arg_string &arg) const
returns either longest matching prefix of 'arg' in any of the flags or the result of the custom match...
Definition: clipp.h:1945
documentation(const group &cli, const doc_formatting &fmt=doc_formatting{}, const param_filter &filter=param_filter{})
Definition: clipp.h:5785
bool all_required() const
returns true, if all children are required to match
Definition: clipp.h:3036
parameter words(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any string consisting of alphanumeric c...
Definition: clipp.h:2232
makes a value from a string and assigns it to an object
Definition: clipp.h:585
parameter opt_integer(const doc_string &label, Targets &&... tgts)
makes optional, blocking value parameter; matches any string that represents an integer
Definition: clipp.h:2394
subrange operator()(const arg_string &s) const
Definition: clipp.h:1641
doc_string doc_label(const parameter &p)
prints first flag or value label of a parameter
Definition: clipp.h:6137
doc_formatting & surround_alternative_flags(const string &prefix, const string &postfix)
determnines strings surrounding alternative flags
Definition: clipp.h:5171
const scoped_dfs_traverser & pos() const noexcept
Definition: clipp.h:4057
bool ommit_outermost_group_surrounders() const
Definition: clipp.h:5337
parsing_result parse(arg_list args, const group &cli)
parses vector of arg strings and executes actions
Definition: clipp.h:4941
predicate that returns true if the length of the input string is wihtin a given interval
Definition: clipp.h:1772
const group * root() const noexcept
Definition: clipp.h:2769
group operator&(parameter a, parameter b)
makes a parameter/group sequence by making all input objects blocking
Definition: clipp.h:3497
group & exclusive(bool yes)
determines if children are mutually exclusive alternatives
Definition: clipp.h:3018
const group * join_group() const noexcept
Definition: clipp.h:3774
bool is_alternative(int minlevel=0) const noexcept
inside a group of alternatives >= minlevel
Definition: clipp.h:2723
Derived & if_missing(simple_action a)
adds an action that will be called if a required parameter is missing
Definition: clipp.h:1252
arg_mappings::size_type unmapped_args_count() const noexcept
returns number of arguments that could not be mapped to a parameter
Definition: clipp.h:4765
const string & alternatives_postfix() const noexcept
Definition: clipp.h:5167
bool start_of_repeat_group() const noexcept
Definition: clipp.h:3791
Definition: clipp.h:263
const string & optional_postfix() const noexcept
Definition: clipp.h:5147
const group & parent() const noexcept
Definition: clipp.h:2791
bool fwd_to_unsigned_int(const char *&s)
forwards string to first non-whitespace char; std string -> unsigned conv yields max value,...
Definition: clipp.h:287
const missing_events & missing() const noexcept
access to range of missing parameter match events
Definition: clipp.h:4804
iterator end() noexcept
returns mutating iterator to position one past the last element
Definition: clipp.h:3244
depth_first_traverser()=default
arg_mapping(arg_index idx, arg_string s, const dfs_traverser &match)
Definition: clipp.h:4191
length min_length(std::size_t min)
makes function object that returns true if the input string has a given minimum length
Definition: clipp.h:1800
iterator begin() const noexcept
returns non-mutating iterator to position of first argument -> parameter mapping
Definition: clipp.h:4808
predicate that returns true if the input string starts with a given prefix
Definition: clipp.h:1726
subrange operator()(const arg_string &s) const
Definition: clipp.h:1664
iterator begin() noexcept
returns mutating iterator to position of first element
Definition: clipp.h:3237
parameter integer(const doc_string &label, Targets &&... tgts)
makes required, blocking value parameter; matches any string that represents an integer
Definition: clipp.h:2358
constexpr flip_bool(bool &target) noexcept
Definition: clipp.h:494
group & joinable(bool yes)
determines if a command line argument can be matched by a combination of (partial) matches through an...
Definition: clipp.h:2984
static unsigned char from(const char *s)
Definition: clipp.h:352
constexpr size_type length() const noexcept
length of the matching subsequence
Definition: clipp.h:102
const dfs_traverser & last_match() const noexcept
Definition: clipp.h:3770
bool all_optional() const
returns true if all children are optional (=non-required)
Definition: clipp.h:3049
constexpr auto check_is_void_callable(int) -> decltype(std::declval< Fn >()(std::declval< Args >()...), std::true_type
Definition: clipp.h:173
int level() const noexcept
Definition: clipp.h:2682
bool operator()(const parameter &p) const noexcept
Definition: clipp.h:4031
bool alphanumeric(const arg_string &s)
predicate that returns true if the argument is a non-empty string that consists only of alphanumeric ...
Definition: clipp.h:1602
bool any_conflict() const noexcept
returns if any argument matched more than one parameter that were mutually exclusive
Definition: clipp.h:4780
contains argument -> parameter mappings and missing parameters
Definition: clipp.h:4744
mixin that provides action definition and execution
Definition: clipp.h:1165
depth_first_traverser & skip_siblings()
don't visit next siblings, go back to parent on next ++ note: renders siblings unreachable for *this
Definition: clipp.h:2865
void remove_ws(std::basic_string< C, T, A > &s)
removes all whitespaces from string
Definition: clipp.h:726
parameter command(String &&flag, Strings &&... flags)
makes required non-blocking exact match parameter
Definition: clipp.h:2048
void ignore_blocking(bool yes)
Definition: clipp.h:3786
int alternatives_min_split_size() const noexcept
Definition: clipp.h:5269
@ yes
length max_length(std::size_t max)
makes function object that returns true if the input string is not longer than a given maximum length
Definition: clipp.h:1811
T & doc(doc_string docstr, token< T > &p)
sets documentation strings on a token
Definition: clipp.h:1539
friend Derived & operator>>(Derived &p, Target &&t)
adds target, see member function 'target'
Definition: clipp.h:1373
parameter opt_value(const doc_string &label, Targets &&... tgts)
makes optional, blocking value parameter; matches any non-empty string
Definition: clipp.h:2154
bool scoped() const noexcept
returns true if operators , & | and other combinating functions will merge groups and false otherwise
Definition: clipp.h:3010
static unsigned short int from(const char *s)
Definition: clipp.h:360
doc_formatting & surround_labels(const string &prefix, const string &postfix)
determnines strings surrounding parameter labels
Definition: clipp.h:5131
doc_formatting & surround_group(const string &prefix, const string &postfix)
determnines strings surrounding non-exclusive groups
Definition: clipp.h:5181
detail::flip_bool flip(bool &b)
makes function object that flips the value of a ref-captured bool
Definition: clipp.h:1104
static unsigned int from(const char *s)
Definition: clipp.h:368
const child * param() const noexcept
Definition: clipp.h:2683
parameter required(String &&flag, Strings &&... flags)
makes required non-blocking exact match parameter
Definition: clipp.h:2063
int section_row_spacing() const noexcept
Definition: clipp.h:6068
std::vector< context > context_list
Definition: clipp.h:2674
doc_formatting & max_flags_per_param_in_usage(int max)
determines maximum number of flags per parameter to be printed in usage lines
Definition: clipp.h:5209
const string & group_postfix() const noexcept
Definition: clipp.h:5187
friend bool operator!=(const depth_first_traverser &a, const depth_first_traverser &b)
Definition: clipp.h:2911
parameter opt_integers(const doc_string &label, Targets &&... tgts)
makes optional, blocking, repeatable value parameter; matches any string that represents an integer
Definition: clipp.h:2412
subrange first_number_match(std::basic_string< C, T, A > s, C digitSeparator=C(','), C decimalPoint=C('.'), C exponential=C('e'))
returns first substring match (pos,len) within the input string that represents a number (with at max...
Definition: clipp.h:917
bool split_alternatives() const noexcept
Definition: clipp.h:5259
group operator,(parameter a, parameter b)
makes a group of parameters and/or groups
Definition: clipp.h:3369
man_page & prepend_section(string title, string content)
Definition: clipp.h:6025
bool blocking() const noexcept
returns if a group/parameter is blocking/positional
Definition: clipp.h:1474
bool any_optional() const
returns true if any child is optional (=non-required)
Definition: clipp.h:3045
Derived & set(Target &t)
adds an action that will set the value of 't' from a 'const char*' arg
Definition: clipp.h:1215
friend parameter & with_prefix(const arg_string &prefix, parameter &p)
prepend prefix to each flag
Definition: clipp.h:1978
bool operator()(const parameter &p) const noexcept
returns true, if parameter satisfies all filters
Definition: clipp.h:5035
detail::decrement< T > decrement(T &target)
makes function object that increments by a fixed amount using operator +=
Definition: clipp.h:1141
bool represents_integer(const std::basic_string< C, T, A > &candidate, C digitSeparator=C(','))
returns true if candidate string represents an integer
Definition: clipp.h:1033
depth_first_traverser & next_after_siblings()
go to next position after siblings of current
Definition: clipp.h:2828
const child * operator->() const noexcept
Definition: clipp.h:2786
Derived & operator()(arg_action a)
adds an action that has an operator() that is callable with a 'const char*' argument
Definition: clipp.h:1204
usage_lines(const group ¶ms, string prefix="", const doc_formatting &fmt=doc_formatting{})
Definition: clipp.h:5320
predicate that returns true if the input string contains a given substring
Definition: clipp.h:1705
const pattern & operator*() const noexcept
Definition: clipp.h:3777
constexpr increment_by(T &target, T by) noexcept
Definition: clipp.h:562
assigns boolean constant to one or multiple target objects
Definition: clipp.h:466
Derived & if_conflicted(simple_action a)
adds an action that will be called if a parameter match was in conflict with a different alternative ...
Definition: clipp.h:1293
scoped_dfs_traverser & next_after_siblings()
Definition: clipp.h:3801
const dfs_traverser & base() const noexcept
Definition: clipp.h:3769
bool valid() const noexcept
returns false if previously processed command line arguments lead to an invalid / inconsistent parsin...
Definition: clipp.h:4342
bool has_postfix(const std::basic_string< C, T, A > &subject, const std::basic_string< C, T, A > &postfix)
returns true, if the 'postfix' argument is a postfix of the 'subject' argument
Definition: clipp.h:760
bool any_flagless() const
returns if any child is a value parameter (recursive)
Definition: clipp.h:3083
const string & label_postfix() const noexcept
Definition: clipp.h:5137
doc_formatting & surround_repeat(const string &prefix, const string &postfix)
determnines strings surrounding repeatable parameters/groups
Definition: clipp.h:5151
match_t full_match(scoped_dfs_traverser pos, const arg_string &arg, const Predicate &select)
finds the first parameter that matches a given string candidate parameters are traversed using a scop...
Definition: clipp.h:4076
const string & flag_separator() const noexcept
Definition: clipp.h:5127
scoped_dfs_traverser()=default
const string & group_separator() const noexcept
Definition: clipp.h:5106
const string & joinable_prefix() const noexcept
Definition: clipp.h:5196
const group * repeat_group() const noexcept
Definition: clipp.h:3773
command line parameter that can match one or many arguments.
Definition: clipp.h:1831
detail::assign_value< bool > unset(bool &target)
makes function object that sets a bool to false
Definition: clipp.h:1094
parameter number(const doc_string &label, Targets &&... tgts)
makes required, blocking value parameter; matches any string that represents a number
Definition: clipp.h:2286
bool merge_alternative_flags_with_common_prefix() const noexcept
Definition: clipp.h:5238
generates parameter and group documentation from docstrings
Definition: clipp.h:5781
constexpr bool prefix() const noexcept
returns true, if query string is a prefix of the subject string
Definition: clipp.h:105
arg_string common_flag_prefix() const
returns longest common prefix of all flags
Definition: clipp.h:3305
constexpr auto check_is_void_callable_without_arg(int) -> decltype(std::declval< Fn >()(), std::true_type
Definition: clipp.h:182
int max_flags_per_param_in_usage() const noexcept
Definition: clipp.h:5213
bool any_blocked() const noexcept
returns if any argument could only be matched by an unreachable parameter
Definition: clipp.h:4773
bool blocking() const noexcept
returns if the entire group is blocking / positional
Definition: clipp.h:3056
parameter opt_number(const doc_string &label, Targets &&... tgts)
makes optional, blocking value parameter; matches any string that represents a number
Definition: clipp.h:2322
scoped_dfs_traverser & next_alternative()
Definition: clipp.h:3798
positive_integers(char digitSeparator=' ')
Definition: clipp.h:1683
parameter opt_words(const doc_string &label, Targets &&... tgts)
makes optional, blocking, repeatable value parameter; matches any string consisting of alphanumeric c...
Definition: clipp.h:2268
filter predicate for parameters and groups; Can be used to limit documentation generation to paramete...
Definition: clipp.h:5005
arg_string common_flag_prefix() const noexcept
common flag prefix of all flags in current group
Definition: clipp.h:2774
bool operator()(const parameter &p) const noexcept
Definition: clipp.h:4037
@ either
subrange substring_match(const std::basic_string< C, T, A > &subject, const std::basic_string< C, T, A > &query)
returns the first occurrence of 'query' within 'subject'
Definition: clipp.h:897
parameter numbers(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any string that represents a number
Definition: clipp.h:2304
const string & alternative_param_separator() const noexcept
Definition: clipp.h:5113
arg_index parse_count() const noexcept
returns number of processed command line arguments
Definition: clipp.h:4337
const string & alternatives_prefix() const noexcept
Definition: clipp.h:5166
match_t partial_match(scoped_dfs_traverser pos, const arg_string &arg, const Predicate &select)
finds the first parameter that partially matches a given string; candidate parameters are traversed u...
Definition: clipp.h:4143
const string & joinable_postfix() const noexcept
Definition: clipp.h:5197
void trimr(std::basic_string< C, T, A > &s)
removes trailing whitespace from string
Definition: clipp.h:675
void execute_actions(const arg_string &arg) const
executes all argument actions
Definition: clipp.h:1388
bool is_first_in_group() const noexcept
Definition: clipp.h:2701
std::function< subrange(const arg_string &)> match_function
Definition: clipp.h:127
parameter word(const doc_string &label, Targets &&... tgts)
makes required, blocking value parameter; matches any string consisting of alphanumeric characters
Definition: clipp.h:2214
depth_first_traverser & operator++()
go to next element of depth first search
Definition: clipp.h:2798
doc_formatting & surround_alternatives(const string &prefix, const string &postfix)
determnines strings surrounding exclusive groups
Definition: clipp.h:5161
bool is_last_in_path() const noexcept
Definition: clipp.h:2711
doc_formatting & surround_joinable(const string &prefix, const string &postfix)
determnines strings surrounding joinable groups
Definition: clipp.h:5191
missing_event(const parameter *p, arg_index after)
Definition: clipp.h:4245
bool nonempty(const arg_string &s)
predicate that returns true if the argument string is non-empty string
Definition: clipp.h:1589
subrange operator()(const arg_string &s) const
Definition: clipp.h:1685
predicate that returns true if the input string represents a non-negative integer (with optional digi...
Definition: clipp.h:1680
group & operator=(const group &)=default
friend bool operator==(const depth_first_traverser &a, const depth_first_traverser &b)
Definition: clipp.h:2894
friend class depth_first_traverser
Definition: clipp.h:2678
parameter && with_prefixes_short_long(const arg_string &shortpfx, const arg_string &longpfx, parameter &&p)
recursively prepends a prefix to all flags
Definition: clipp.h:3687