diff --git a/content/posts/cli-best-practices.gmi b/content/posts/cli-best-practices.gmi index 2a54389..ecc1fa9 100644 --- a/content/posts/cli-best-practices.gmi +++ b/content/posts/cli-best-practices.gmi @@ -86,7 +86,7 @@ Avoiding reliance on color and using whitespace and/or indentation for pseudo-he 2. Try adding shell completions for your program, so users can tab-complete options. This is particularly helpful in shells like Zsh that support help-text in tab completions, especially when combined with plugins like fzf-tab that enable fuzzy-searching help-text (see "code snippet 2") => https://github.com/Aloxaf/fzf-tab fzf-tab on GitHub -3. Related to no. 2: use a well-understood format for "-h" and "--help" output. This makes auto-generating shell completions much easier. Alternatively, delegate the generation of both to a library that follows this advice. +3. Related to no. 2: use a well-understood format for "-h" and "--help" output. This makes auto-generating shell completions much easier. A great example is the Busybox coreutils' help output: it is much more concise than manpages, but descriptive enough to serve as a quick reference. Alternatively, delegate the generation of both to a library that follows this advice. 4. Ensure that the "whatis" and "apropos" commands work as intended after installing your man pages. These commands parse the beginnings of man pages to give one-line summaries of programs, and often power advanced tab-completion setups. diff --git a/content/posts/cli-best-practices.md b/content/posts/cli-best-practices.md index a777a55..7d24936 100644 --- a/content/posts/cli-best-practices.md +++ b/content/posts/cli-best-practices.md @@ -99,7 +99,7 @@ This is a non-exhaustive list of simple, baseline recommendations for designing 2. Try adding shell completions for your program, so users can tab-complete options. This is particularly helpful in shells like Zsh that support help-text in tab completions, especially when combined with plugins like [fzf-tab](https://github.com/Aloxaf/fzf-tab) that enable fuzzy-searching help-text (see [code snippet 2](#code-2)). -3. Related to no. 2: use a well-understood format for `-h` and `--help` output. This makes auto-generating shell completions much easier. Alternatively, delegate the generation of both to a library that follows this advice. +3. Related to no. 2: use a well-understood format for `-h` and `--help` output. This makes auto-generating shell completions much easier. A great example is the [Busybox coreutils'](https://www.busybox.net/) help output: it is much more concise than man pages, but descriptive enough to serve as a quick reference. Alternatively, delegate the generation of both to a library that follows this advice. 4. Ensure that the `whatis` and `apropos` commands work as intended after installing your man pages. These commands parse the beginnings of man pages to give one-line summaries of programs, and often power advanced tab-completion setups.