clap-complete-command icon indicating copy to clipboard operation
clap-complete-command copied to clipboard

Add man page support

Open nihaals opened this issue 1 year ago • 0 comments

clap_mangen already has a signature similar to clap_complete::generator::generate, and if we write our own implementation for clap_complete::generator::generate_to, we can add Man/ManPage to Shells without any changes needed for users.

An advantage to adding this to the library is that it provides a nicer interface for end users, and avoids needing something like a completions and a manpage command. A workaround could be adding a flag to the completions command, which feels awkward as it's mutually exclusive with providing a shell, and also feels like it's meant to be an argument.

We should probably add this as a feature flag as some library users may already generate man pages themselves or aren't interested in providing man pages, and man pages are slightly different to providing shell completions.

If we make a breaking change bump, we could make it a default feature flag, as users are more likely to see the addition and opt out, but as clap_mangen is <1.0, we can delay this for a future release, which will also give us information on how many people want man page generation.

nihaals avatar Nov 02 '22 16:11 nihaals