-
Notifications
You must be signed in to change notification settings - Fork 0
QandA
To help you quickly creating a command line program with commands, subcommands, flags, env vars, and config file.
This libary is highly biased towards my personal preferences. It might not match your requirements. I do not aim at delivering a one-size-fits-all library; however, suggestions for new features are always welcome.
The cli libraries I found so far only have one or two of the above features (e.g. either command/subcommand handling, or combined flag/config file handling). I figured that having this all together requires a single library to manage all of this in an integrated way.
I took this situation as a great excuse for starting my first real-life Go project, so if this library does not fill any gap, at least it helped me getting up to speed with Go.
Consider these alternatives:
- spf13/cobra
- codegangsta/cli
- mitchellh/cli
- and many more.
I do not understand why the standard library does not support POSIX flags. After all, these are quite standard for command line tools on Unix-flavored operating systems.
Why TOML? Will start also support YAML/JSON/XML/[insert your favorite config file language] in the future?
- Simple syntax
- Libraries available
- And as said, the start library is highly biased. It does not try to be generic or format-agnostic, so you probably will not see this library supporting other config file formats.
So let me know what you found, and how I should make this more idiomatic.
This is my first published Go library, so expect some non-idiomatic code inside. My primary goal was to get this working in order to have something to build my commandline programs upon. It is not perfect but I am learning. I am always happy to hear your constructive criticism, tips, or suggestions.