Commit 02208064f3dfbc462a3d8bb8ada0d0451b50b76b
1 parent
bd48b99c
Typo fix
Showing
1 changed file
with
1 additions
and
1 deletions
README.md
| @@ -162,7 +162,7 @@ Subcommands are supported, and can be nested infinitly. To add a subcommand, cal | @@ -162,7 +162,7 @@ Subcommands are supported, and can be nested infinitly. To add a subcommand, cal | ||
| 162 | case). | 162 | case). |
| 163 | If you want to require at least one subcommand is given, use `.require_subcommand()` on the parent app. You can optionally give an exact number of subcommands to require, as well. | 163 | If you want to require at least one subcommand is given, use `.require_subcommand()` on the parent app. You can optionally give an exact number of subcommands to require, as well. |
| 164 | 164 | ||
| 165 | -All `App`s have a `get_subcommands()` method, which returns a list of pointers to the subcommand passed on the command line. A simple compare of these pointers to each subcommand allows choosing based on subcommand, facilitated by a `got_subcommand(App_or_name) method that will check the list for you. For many cases, however, using an app's callback may be easier. Every app executes a callback function after it parses; just use a lambda function (with capture to get parsed values) to `.set_callback`. If you throw `CLI::Success`, you can | 165 | +All `App`s have a `get_subcommands()` method, which returns a list of pointers to the subcommand passed on the command line. A simple compare of these pointers to each subcommand allows choosing based on subcommand, facilitated by a `got_subcommand(App_or_name)` method that will check the list for you. For many cases, however, using an app's callback may be easier. Every app executes a callback function after it parses; just use a lambda function (with capture to get parsed values) to `.set_callback`. If you throw `CLI::Success`, you can |
| 166 | even exit the program through the callback. The main `App` has a callback slot, as well, but it is generally not as useful. | 166 | even exit the program through the callback. The main `App` has a callback slot, as well, but it is generally not as useful. |
| 167 | If you want only one, use `app.require_subcommand(1)`. You are allowed to throw `CLI::Success` in the callbacks. | 167 | If you want only one, use `app.require_subcommand(1)`. You are allowed to throw `CLI::Success` in the callbacks. |
| 168 | Multiple subcommands are allowed, to allow [`Click`](http://click.pocoo.org) like series of commands (order is preserved). | 168 | Multiple subcommands are allowed, to allow [`Click`](http://click.pocoo.org) like series of commands (order is preserved). |