You probably missed pflag (https://github.com/spf13/pflag) which is what
I use for anything more than one off programs. That is not to say that
other getopt libraries are not good. Just that when I started working on
golang, I was looking for the same short-style/long-style support as you
are, and that library was really popular (it is what spf13 / cobra is
based on I think) and I have never looked back.
I used https://github.com/alecthomas/kingpin too and I liked the
fluent-style syntax. Though the author has moved on to Kong.
I use cobra for full fledged CLI apps, with subcommands, automatic
environment/config file integration (with spf13/viper).
So, based on how extensive your app is, you have many options - I just
listed mine, but again, not to say other libraries are not better.
Thanks,
Sandip
On 04.09.21 20:48, jlfo...@berkeley.edu wrote:
I'm wondering what the current state of GNU getopt-style Go packages is.
I've done some research and found the following:
DavidGamba / go-getoptions
alecthomas / kong
elegos / flags
jessevdk / go-flags
pborman / getopt
pborman / options
skeeto / optparse-go
spf13 / cobra
subchen / go-cli
tcler / cmdline-go
urfave / cli
vma / getopt
Some of these don't look active, and I'm sure I've missed some.
Any comments on any of the above? What have you used for command line
parsing in the past, and what would you use in the future?
Cordially,
Jon Forrest
UC Berkeley (ret.)
** --
You received this message because you are subscribed to the Google
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/8dd1a249-68c3-466f-a571-46b7df3b1c97n%40googlegroups.com
<https://groups.google.com/d/msgid/golang-nuts/8dd1a249-68c3-466f-a571-46b7df3b1c97n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/410f3408-e8f3-6ac9-af63-6d3e85d511bc%40showmethesource.org.