From aec97a6f53c3486fc51e0d9857f10b683180d668 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Thu, 28 Jan 2016 07:26:10 +1100 Subject: [PATCH] update readme --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7022fb..dbffee8 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Create a cxxopts::Options instance. cxxopts::Options options; -Then use add_options. +Then use `add_options`. options.add_options() ("d,debug", "Enable debugging") @@ -46,13 +46,22 @@ it appeared, and to get its value. If "opt" doesn't exist, or isn't of the right type, then an exception will be thrown. +## Help groups + +Options can be placed into groups for the purposes of displaying help messages. +To place options in a group, pass the group as a string to `add_options`. Then, +when displaying the help, pass the groups that you would like displayed as a +vector to the `help` function. + ## Positional Arguments -Positional arguments can be optionally parsed into one or more options. To set up positional arguments, call +Positional arguments can be optionally parsed into one or more options. +To set up positional arguments, call options.parse_positional({"first", "second", "last"}) -where "last" should be the name of an option with a container type, and the others should have a single value. +where "last" should be the name of an option with a container type, and the +others should have a single value. # Linking -- libgit2 0.21.4