diff options
author | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-23 21:07:26 +0300 |
---|---|---|
committer | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-23 21:07:26 +0300 |
commit | 4b983b8f035dbd854edc3fd50c767d913bf775ad (patch) | |
tree | 6ce5b4ed6fddd56ff6a366c537a02bd8fa196630 /README.md | |
parent | fix bash equal sign tokenization (diff) | |
download | args.hxx-4b983b8f035dbd854edc3fd50c767d913bf775ad.tar.xz |
add examples
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -63,6 +63,7 @@ It: * Allows one value flag to take a specific number of values (like `--foo first second`, where --foo slurps both arguments). * Allows you to have value flags only optionally accept values +* Provides autocompletion for bash # What does it not do? @@ -179,10 +180,16 @@ int main(int argc, char **argv) { args::ArgumentParser parser("This is a test program.", "This goes after the options."); args::HelpFlag help(parser, "help", "Display this help menu", {'h', "help"}); + args::CompletionFlag completion(parser, {"complete"}); try { parser.ParseCLI(argc, argv); } + catch (args::Completion e) + { + std::cout << e.what(); + return 0; + } catch (args::Help) { std::cout << parser; |