CBMC
free_form_cmdline.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Unit test utilities
4 
5 Author: Diffblue Limited.
6 
7 \*******************************************************************/
8 
9 #include "free_form_cmdline.h"
10 
13 void free_form_cmdlinet::create_flag(const std::string &flag_name)
14 {
15  optiont option;
16  option.optstring = flag_name;
17  options.push_back(option);
18 }
19 
22 void free_form_cmdlinet::add_flag(std::string flag)
23 {
24  create_flag(flag);
25  set(flag);
26 }
27 
31 void free_form_cmdlinet::add_option(std::string flag, std::string value)
32 {
33  create_flag(flag);
34  set(flag, value);
35 }
std::vector< optiont > options
Definition: cmdline.h:190
virtual void set(const std::string &option, bool value=true)
Set option option to value, or true if the value is omitted.
Definition: cmdline.cpp:58
void create_flag(const std::string &flag_name)
Create a command line option that can be set.
void add_flag(std::string flag)
Equivalent to specifying –flag for the command line.
void add_option(std::string flag, std::string value)
Equivalent to specifying –flag value.
std::string optstring
Definition: cmdline.h:167