Using command-line flags

The flag package makes it simple to add command-line flag arguments to a Go application. It has a few shortcomings—you tend to duplicate a lot of code in order to add shorthand versions of flags, and they're ordered alphabetically from the help prompt. There are a number of third-party libraries that attempt to address these shortcomings, but this chapter will focus on the standard library version and not on those libraries.