From 10aa9551fd8488a217ffceb0d4fbc51898af63b4 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Mon, 13 Jun 2022 17:03:42 -0700 Subject: [PATCH] Mention Busybox as an example --- content/posts/cli-best-practices.gmi | 2 +- content/posts/cli-best-practices.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.