by qwerty2021 · 5y ago · 0 comments
Why the fuck do all these leftpad is-even hello-world tic-tac-toe packages have millions of downloads?
Even POSIX gives you getopt(1) and getopt(3). What other language doesn't? I can only think of Java.
it absolutely does not belong in stdlibs, where it can never be changed. that's how you end up with too many terrible CLI tools using Go's `flags` package.
20-30 LoC maybe. `process.argv.slice(2).forEach(str => ... )`.
there is no access to the raw command-line invocation, sadly, so you really can't really do anything fancier than that.
>config loading
that thing "RC" package does - looking up the config file in random locations - is really strange to me. aren't you the one in control of where it is stored?
And perhaps some faked download numbers to lend an air of authenticity.