Releases: mediocregopher/flagconfig
New features
I added a bunch of new features which make creating command-line utilities easier.
Previously I had used flagconfig mostly for working with server applications, but I had to make a command-line utility recently and a bunch of features came out of that:
- SetDefaultConfigFile, IgnoreMissingConfigFile - Useful for automatically looking for a configuration file for a program and loading it if found (think vimrc or bashrc)
- Ability to change delimiter (
--
be default) - Ability to make certain options only set-able on the command-line
Tablewriter and bugfixes
Use the github.com/mediocregopher/tablewriter
package for prettier output on --help
, and some bug-fixes related to how default values are shown on the command-lline and in the conf file
Use newest goat syntax
Goat v1.0.0 is out, so I'm switching over to its new yaml syntax.
Two new features, and slight breakage for import statements
Three things happened in this release:
- The import path is now
github.com/mediocregopher/flagconfig
- New method
DisallowConfig
which makes it possible to only use flagconfig for command-line parsing - New method
GetPositionals
which returns all command-line parameters which aren't actual--key=value
options
Bug fixes
Fixed a couple bugs:
- Example output wasn't showing default string values properly
- The help output wasn't showing the
--help
,--config
, or--example
arguments - boolean flags were showing a default value, which doesn't really make sense
More parameter types, and params always get listed in same order
Added the following parameter types:
- RequiredStrParam - Like StrParam, but with no default value. It must be given
- RequiredIntParam - Similar to RequiredStrParam
- IntParams - Multiple ints, similar to StrParams
When listing parameters in both the help menu and the example config file, parameters will now always show up in the order they were given.
New option parser and help menu
I wrote a command-line option parser from scratch since goopt just wasn't cutting it. This one lets me know whether or not a variable has actually been set on the command-line or not (rather then just providing the default value), which fixes a couple bugs and simplifies my code a lot. It also means the help menu is supa-sexy now
Basic functionality
Basic flag/configuration file reading implemented for single strings, multiple strings, and integers. Currently relying on goopt but that may change.