by breckuh · 8y ago · 0 comments
I like how this is their #1. In my opinion the best way to do this is with tldr.
https://github.com/tldr-pages/tldr
I'd highly recommend folks create a tldr page for their CLI app. Add 4-8 examples to cover 80%+ of the most common use cases. -h flags, readmes & man pages can cover the other 20%.
I hadn't considered this before you mentioned it, but oclif CLIs could integrate to tldr pretty well. It already supports arrays of strings for examples.
We're doing that for our internal CLI applications and it's great to be able to just copy-paste the common use case from the top of the documentation without searching much.
Using it less as a complete docopts kind of thing and more of multiple common usages (like `man tar` and what you linked) is far more useful.
I think there is something here I hadn't really considered before. It's not an example, but also not a useless dump of flags. Food for thought I suppose.