Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_CMDLINE_H
11 #define CPROVER_UTIL_CMDLINE_H
75 virtual bool parse(
int argc,
const char **argv,
const char *optstring);
78 std::string
get_value(
const char *option)
const;
80 const std::list<std::string> &
get_values(
const std::string &option)
const;
81 const std::list<std::string> &
get_values(
char option)
const;
87 virtual bool isset(
char option)
const;
88 virtual bool isset(
const char *option)
const;
90 virtual void set(
const std::string &option,
bool value =
true);
91 virtual void set(
const std::string &option,
const std::string &value);
92 virtual void set(
const std::string &option,
const char *value)
94 set(option, std::string{value});
101 return getoptnr(option).has_value();
108 :
public std::iterator<std::forward_iterator_tag, std::string>
129 std::size_t
index = std::numeric_limits<std::size_t>::max();
144 typedef std::vector<std::string>
argst;
151 std::vector<std::string>
190 #endif // CPROVER_UTIL_CMDLINE_H
const std::string & operator*()
virtual bool parse(int argc, const char **argv, const char *optstring)
Parses a commandline according to a specification given in optstring.
option_names_iteratort begin()
virtual bool isset(char option) const
bool parse_arguments(int argc, const char **argv)
Parses a commandline according to a previously parsed optstring and writes the result to cmdlinet::op...
void goto_next_valid_index()
virtual void set(const std::string &option, const char *value)
std::vector< optiont > options
option_names_iteratort()=default
void parse_optstring(const char *optstring)
Parses an optstring and writes the result to cmdlinet::options.
std::list< std::string > get_comma_separated_values(const char *option) const
Collect all occurrences of option option and split their values on each comma, merging them into a si...
virtual void set(const std::string &option, bool value=true)
Set option option to value, or true if the value is omitted.
bool has_option(const std::string &option) const
bool operator!=(const option_names_iteratort &other)
option_namest(const cmdlinet &command_line)
const cmdlinet & command_line
std::string get_value(char option) const
option_names_iteratort & operator++()
option_namest option_names() const
Pseudo-object that can be used to iterate over options in this cmdlinet (should not outlive this)
nonstd::optional< T > optionalt
std::list< std::string > values
optionalt< std::size_t > getoptnr(char option) const
bool is_valid_index() const
const cmdlinet * command_line
bool operator==(const option_names_iteratort &other)
std::vector< std::string > get_argument_suggestions(const std::string &unknown_argument)
option_names_iteratort end()
const std::list< std::string > & get_values(const std::string &option) const
option_names_iteratort & operator=(const option_names_iteratort &)=default
std::vector< std::string > argst