dev/sg: markdown doc generator
Created by: bobheadxi
Migrates the existing sg
usage examples into UsageText
, which is used to generate similar docs as before, except now automatically annotated with more details about the command. This centralizes all documentation within sg
code, so that consistent help is available both on docs.sourcegraph.com and locally.
Closes https://github.com/sourcegraph/sourcegraph/issues/33872
The code for markdown generation is ~mostly pulled directly from urfave/cli
, hence a little messy. Would like to just focus on landing this and iterating a bit more in the future though, given this is just docs.