aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPavel Belikov <pavel.fuchs.belikov@gmail.com>2017-12-23 21:07:26 +0300
committerPavel Belikov <pavel.fuchs.belikov@gmail.com>2017-12-23 21:07:26 +0300
commit4b983b8f035dbd854edc3fd50c767d913bf775ad (patch)
tree6ce5b4ed6fddd56ff6a366c537a02bd8fa196630 /README.md
parentfix bash equal sign tokenization (diff)
downloadargs.hxx-4b983b8f035dbd854edc3fd50c767d913bf775ad.tar.xz
add examples
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/README.md b/README.md
index f3a35d8..5327549 100644
--- a/README.md
+++ b/README.md
@@ -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;