-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65e456c
commit 9f55e50
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
# Completions | ||
|
||
Shell completions and documentation can be generated automatically by this crate. The implementation for this is in the [`uutils-args-complete`] crate. The easiest way of generating completions is via the `parse-is-complete` feature flag. This feature flag hijacks the [`Options::parse`](crate::Options::parse) function to print completions. This means that there is usually no need to write any additional code to generate completions. | ||
|
||
```bash | ||
cargo run --features parse-is-complete -- [shell] | ||
``` | ||
|
||
The `[shell]` value here can be `fish`, `zsh`, `bash`, `powershell`, `elvish` or `nu`. | ||
|
||
> **Note**: Some of these remain unimplemented as of writing. | ||
Additionally, the values `man` or `md` can be passed to generate man pages and markdown documentation (for `mdbook`). | ||
|
||
If you do not want to hijack the [`Options::parse`](crate::Options::parse) function, you can instead enable the `complete` feature flag. This makes the `Options::complete` function available in addition to the [`Options::parse`](crate::Options::parse) function to generate a `String` with the completion. |