add tags and boost for pages
This commit is contained in:
parent
286d5ada85
commit
dac1c40ee5
@ -1,4 +1,7 @@
|
||||
### Arguments
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
You can lookup arguments by calling the `Args` function on `cli.Context`, e.g.:
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
You can enable completion commands by setting the `EnableBashCompletion`
|
||||
flag on the `App` object. By default, this setting will only auto-complete to
|
||||
show an app's subcommands, but you can write your own completion methods for
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
Traditional use of options using their shortnames look like this:
|
||||
|
||||
```
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
Calling `App.Run` will not automatically call `os.Exit`, which means that by
|
||||
default the exit code will "fall through" to being `0`. An explicit exit code
|
||||
may be set by returning a non-nil error that fulfills `cli.ExitCoder`, *or* a
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
Setting and querying flags is simple.
|
||||
|
||||
<!-- {
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
The default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked
|
||||
by the cli internals in order to print generated help text for the app, command,
|
||||
or subcommand, and break execution.
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
Being a programmer can be a lonely job. Thankfully by the power of automation
|
||||
that is not the case! Let's create a greeter app to fend off our demons of
|
||||
loneliness!
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
For additional organization in apps that have many subcommands, you can
|
||||
associate a category for each command to group them together in the help
|
||||
output.
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
Subcommands can be defined for a more git-like command line app.
|
||||
|
||||
<!-- {
|
||||
|
@ -1,4 +1,7 @@
|
||||
### Version Flag
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
The default version flag (`-v/--version`) is defined as `cli.VersionFlag`, which
|
||||
is checked by the cli internals in order to print the `App.Version` via
|
||||
|
@ -1,3 +1,8 @@
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
One of the philosophies behind cli is that an API should be playful and full of
|
||||
discovery. So a cli app can be as little as one line of code in `main()`.
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
## Migrating to V2
|
||||
---
|
||||
tags:
|
||||
- v1
|
||||
---
|
||||
|
||||
There are a small set of breaking changes between v1 and v2.
|
||||
Converting is relatively straightforward and typically takes less than
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
You can lookup arguments by calling the `Args` function on `cli.Context`, e.g.:
|
||||
|
||||
<!-- {
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
You can enable completion commands by setting the `EnableBashCompletion` flag on
|
||||
the `App` object to `true`. By default, this setting will allow auto-completion
|
||||
for an app's subcommands, but you can write your own completion methods for the
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Traditional use of options using their shortnames look like this:
|
||||
|
||||
```sh-session
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Calling `App.Run` will not automatically call `os.Exit`, which means that by
|
||||
default the exit code will "fall through" to being `0`. An explicit exit code
|
||||
may be set by returning a non-nil error that fulfills `cli.ExitCoder`, *or* a
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Setting and querying flags is simple.
|
||||
|
||||
<!-- {
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
**Notice**: This is a contrived (functioning) example meant strictly for API
|
||||
demonstration purposes. Use of one's imagination is encouraged.
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
The default help flag (`-h/--help`) is defined as `cli.HelpFlag` and is checked
|
||||
by the cli internals in order to print generated help text for the app, command,
|
||||
or subcommand, and break execution.
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Being a programmer can be a lonely job. Thankfully by the power of automation
|
||||
that is not the case! Let's create a greeter app to fend off our demons of
|
||||
loneliness!
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
For additional organization in apps that have many subcommands, you can
|
||||
associate a category for each command to group them together in the help
|
||||
output, e.g.:
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Subcommands can be defined for a more git-like command line app.
|
||||
|
||||
<!-- {
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
To enable flag and command suggestions, set `app.Suggest = true`. If the suggest
|
||||
feature is enabled, then the help output of the corresponding command will
|
||||
provide an appropriate suggestion for the provided flag or subcommand if
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
Using the timestamp flag is simple. Please refer to
|
||||
[`time.Parse`](https://golang.org/pkg/time/#example_Parse) to get possible
|
||||
formats.
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
The default version flag (`-v/--version`) is defined as `cli.VersionFlag`, which
|
||||
is checked by the cli internals in order to print the `App.Version` via
|
||||
`cli.VersionPrinter` and break execution.
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
One of the philosophies behind cli is that an API should be playful and full of
|
||||
discovery. So a cli app can be as little as one line of code in `main()`.
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- v2
|
||||
search:
|
||||
boost: 2
|
||||
---
|
||||
|
||||
There are a small set of breaking changes between v1 and v2. Converting is
|
||||
relatively straightforward and typically takes less than an hour. Specific steps
|
||||
are included in [Migration Guide: v1 to v2](../migrate-v1-to-v2.md). Also see
|
||||
|
Loading…
Reference in New Issue
Block a user