mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-04-29 12:13:52 +00:00
add some comments in readME about performance move operator[] to return const Option * Apply suggestions from code review Co-Authored-By: phlptp <top1@llnl.gov> update readme and add some IniTests and fix a bug from the tests add_flag_callback add a few tests to capture the different paths fix incorrectly updated CMAKE file, and add some subcommand test for option finding add disable_flag_override and work out some kinks in the find option functions add some more tests and fix a few bugs in as<> function for options Allow general flag types and default values, add shortcut notation for retrieving values
16 lines
381 B
C++
16 lines
381 B
C++
#include <CLI/CLI.hpp>
|
|
#include <iostream>
|
|
|
|
int main(int argc, char **argv) {
|
|
CLI::App app;
|
|
|
|
int val;
|
|
// add a set of flags with default values associate with them
|
|
app.add_flag("-1{1},-2{2},-3{3},-4{4},-5{5},-6{6}, -7{7}, -8{8}, -9{9}", val, "compression level");
|
|
|
|
CLI11_PARSE(app, argc, argv);
|
|
|
|
std::cout << "value = " << val << std::endl;
|
|
return 0;
|
|
}
|