Skip to content
christophberger edited this page Oct 19, 2017 · 2 revisions

Questions & Answers

What is it for?

To help you quickly creating a command line program with commands, subcommands, flags, env vars, and config file.

Caveat

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.

Why another command line library?

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.

I don't like this library/It does not meet my needs.

Consider these alternatives:

Why pflag?

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.

I found some code in your library that is not idiomatic Go.

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.