bob.hpp
Loading...
Searching...
No Matches
bob::CliFlag Struct Reference

Represents a command flag argument. More...

#include <bob.hpp>

Public Member Functions

 CliFlag (const string &long_name, CliFlagType type, string description="")
 Create a CLI flag.
 
 CliFlag (char short_name, CliFlagType type, string description="")
 Create a CLI flag.
 
 CliFlag (char short_name, const string &long_name, CliFlagType type, string description="")
 Create a CLI flag.
 
bool is_flag () const
 Checks if the flag is a boolean flag (no value).
 
bool is_option () const
 Checks if the flag is an option (has a value).
 

Public Attributes

char short_name = '\0'
 The short name of the flag, e.g. -v.
 
string long_name = ""
 The long name of the flag, e.g. --verbose.
 
string description = ""
 Description of the flag, e.g. "Enable verbose output".
 
bool set = false
 Whether the flag is set or not.
 
string value = ""
 
CliFlagType type
 The type of the flag..
 

Detailed Description

Represents a command flag argument.

Member Data Documentation

◆ value

string bob::CliFlag::value = ""

The value of the flag if it is an option with a value, e.g. file.txt for --output file.txt.

Only used for options with values.


The documentation for this struct was generated from the following file: