6 ms·
Please please please use standard command line flag format (getopt_long) instead of the Go’s flag format. It’s super irritating that Go programs do it their own
by danielparks 7y ago
Please please please use standard command line flag format (getopt_long) instead of the Go’s flag format. It’s super irritating that Go programs do it their own, less convenient way.
For example: https://github.com/DavidGamba/go-getoptions https://github.com/DavidGamba/go-getoptions
- snailmailman 7y agoI’m not sure I understand, what’s the difference? I’ve never had any problems using go programs’ command line flags myself.
- oarsinsync 7y agoI believe GP's remarks are that single hyphen followed by letters should each be individual flags, and double hyphen followed letters is a single flag in long form. The application in question is using -generate rather than --generate.
- danielparks 7y agooarsinsync is correct. The standard on most UNIX-like OSes is that long options, e.g. --long, have two dashes, and short options, e.g. -l, have one. It allows you to combine multiple options into one. For example, the following two commands are equivalent: $ ls -laF $ ls -l -a -F