Closed atc0005 closed 4 years ago
Note to self; starting point for CHANGELOG entry related to this work:
- Usage/branding details shown for invalid subcommands, flags or just general
Help output
Really struggling with this one for some reason. Scratch notes below in case writing this out here helps to make things "click".
Some references that I've consulted thus far:
Some I've started looking over, but haven't finished with yet:
Regarding the references linked above:
the Digital Ocean tutorial
the Go by Example tutorial
os.Args[1]
and parse the matching flagsetthe Gopher Academy Blog tutorials (Miki Tebeka)
usage
function for main application or "command" (e.g., os.Args[0]
)Sam's Teach Yourself Go in 24 Hours
flag.Usage
to list supported subcommandsUsage
for each subcommandLearning CoreDNS
While reading over Fun with Flags I learned that the stdlib
flag
package supports displaying custom help text as a header or lead-in to the auto-generated list of options available to the user. This can be used to display branding, version details and a link back to the main project repo.