Skip to content

Commit

Permalink
Merge pull request #623 from rsteube/doc-usage
Browse files Browse the repository at this point in the history
doc: added usage
  • Loading branch information
rsteube authored Nov 27, 2022
2 parents bc514de + 14a6536 commit 93ca86c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [Suppress](./carapace/action/suppress.md)
- [Style](./carapace/action/style.md)
- [Tag](./carapace/action/tag.md)
- [Usage](./carapace/action/usage.md)
- [InvokedAction](./carapace/invokedAction.md)
- [Filter](./carapace/invokedAction/filter.md)
- [Merge](./carapace/invokedAction/merge.md)
Expand Down
22 changes: 22 additions & 0 deletions docs/src/carapace/action/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Usage

[`Usage`] sets the `usage` message.

> `usage` is implicitly set by default with [`Flag.Usage`] for flag and [`Command.Use`] for positional arguments.
```go
carapace.ActionValues().Usage("explicit usage")
````

```json
{
"Version": "unknown",
"Usage": "explicit usage",
"Nospace": "",
"RawValues": []
}
```

[`Usage`]: https://pkg.go.dev/github.com/rsteube/carapace#Action.Usage
[`Command.Use`]:https://pkg.go.dev/github.com/spf13/cobra#Command
[`Flag.Usage`]:https://pkg.go.dev/github.com/spf13/pflag#Flag

0 comments on commit 93ca86c

Please sign in to comment.