github.com/boreq/guinea (go): Package guinea is a command line interface library.  This library operates on a tree-like structure of available commands. In the following example we define a root command with two subcommands. It will most likely be the best to define the commands as global variables in your package.  After defining the commands use the run function to execute them. The library will read os.Args to determine which command should be executed and to populate the context passed to it with options and arguments.  The user can invoke a program in multiple ways.  To let the user call a command with arguments or options populate the proper lists in the command struct.  If you wish to parse the arguments in a different way simply don't define any options or arguments in the command struct and pass the arguments from the context to your parsing function.
Keywords: cli|command-line|go|golang