-
Notifications
You must be signed in to change notification settings - Fork 1
Go Flags
This page is intended for users of jessevdk/go-flags.
I originally worked on enhancing this library, but I got to find octago/sflags
, which would take
a smarter approach at generating flags which were compliant with other battle-tested libraries,
such as pflag
(the flag library used by cobra).
From there, I got to realize that generating structs directly into cobra commands would exponentially enhance the principles that have been put forward by go-flags, which has had a lot of success. As said in the introduction, resting on cobra command gives many benefits that go-flags could not provide, and it spares everyone the need to maintain two different command/flag/parsing APIs and logic.
It should thus be stressed that one of the main aims of the present library is to allow go-flags users to move to a similar library, but with more modern features out of the box, and while leveraging other libs that have proven their worth, as well as being actively maintained.
I hope that this library will be a success as far as this is concerned.
However, and despite most of the tags used by go-flags being valid in the present library, the following is a gross (hopefully complete) list of the differences between this library and go-flags:
- All
Command
,Option
,Parser
types from go-flags are not present here. - All global parsing options in go-flags have also disappeared. However, it should be noted that cobra has shown that some of those options could be implicitly used without having to specify them.
- The
Completion
type has not been ported, and so as to avoid importing go-flags, any go-flagsCompleter
interface satisfier will not be scanned and translated into aflags.Completer
.