Skip to content

Commit e670f36

Browse files
committed
Updated cclip::options_manager descriptions and usage examples
In the main.cpp file, the text for cclip::options_manager was expanded with a more detailed description and set up usage examples. Furthermore, printing of the version was replaced with manager.print_version().
1 parent e2dbc60 commit e670f36

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

example/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
int main(const int argc, char **argv)
66
{
7-
cclip::options_manager manager("cclip test");
7+
cclip::options_manager manager("CCLIP Example", "This is an example of the cclip library. cclip library is a lightweight command-line argument parsing tool for C++ applications.");
88
manager.add_option("h", "help", "Print this help message", false, false);
99
manager.add_option("v", "version", "Print the version", false, false);
1010
manager.add_option("V", "verbose", "Prints to the console verbosly", false, false);
1111
manager.add_option("f", "file", "The file to read", true, true);
1212

13+
manager.set_version("0.0.1");
14+
manager.add_example_usage(R"(-f C:\Users\user\Desktop\file.txt)");
15+
manager.add_example_usage(R"(-f "C:\Users\user with space\Desktop\file.txt")");
16+
1317
manager.parse(argc, argv);
1418

1519
if (manager.is_present("h"))
@@ -20,7 +24,7 @@ int main(const int argc, char **argv)
2024

2125
if (manager.is_present("v"))
2226
{
23-
std::cout << "cclip test 0.0.1" << std::endl;
27+
manager.print_version();
2428
return 0;
2529
}
2630

0 commit comments

Comments
 (0)