|
Bash++
Bash++ compiler internal documentation
|
Parses command-line arguments based on a set of defined options. More...
#include <xgetopt.h>

Public Member Functions | |
| constexpr std::string_view | getHelpString () const |
| Get the compile-time generated help string. | |
| constexpr const OptionArray & | getOptions () const |
| OptionSequence | parse (int argc, char *argv[]) const |
| Parse command-line arguments according to the defined options. | |
| template<StopCondition end> | |
| std::pair< OptionSequence, OptionRemainder > | parse_until (int argc, char *argv[]) const |
| Parse command-line arguments until a specified condition is met. | |
Private Types | |
| using | OptionArray = std::array< Helpers::OptionView, N > |
Private Member Functions | |
| template<StopCondition parseUntil> | |
| std::pair< OptionSequence, OptionRemainder > | parse_impl (int argc, char *argv[]) const |
Static Private Member Functions | |
| static constexpr std::array< char, 3 *N+2 > | build_short_options_ (const OptionArray &opts) |
| static constexpr std::array< struct option, N+1 > | build_long_options_ (const OptionArray &opts) |
| static constexpr Helpers::FixedString< help_string_length > | generateHelpString (const OptionArray &options) |
Static Private Attributes | |
| static constexpr size_t | N = sizeof...(Options) |
| static constexpr OptionArray | options |
| static constexpr size_t | help_string_length = Helpers::calculate_help_string_length<N>(options) |
| static constexpr std::array< char, 3 *N+2 > | short_options = build_short_options_(options) |
| static constexpr std::array< struct option, N+1 > | long_options = build_long_options_(options) |
| static constexpr Helpers::FixedString< help_string_length > | help_string = generateHelpString(options) |
Parses command-line arguments based on a set of defined options.
| Options | The variadic list of option definitions |
|
private |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inlineconstexpr |
Get the compile-time generated help string.
|
inlineconstexpr |
|
inline |
Parse command-line arguments according to the defined options.
| argc | The argument count |
| argv | The argument vector |
|
inlineprivate |
|
inline |
Parse command-line arguments until a specified condition is met.
This overload allows specifying a condition to stop parsing early, such as stopping at the first non-option argument or the first error.
| end | The condition to stop parsing at |
| argc | The argument count |
| argv | The argument vector |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |