aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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;