-
-
Notifications
You must be signed in to change notification settings - Fork 30
Description
From the Lobste.rs thread:
So regarding argparsing: It's a spectrum and everything has tradeoffs, additionally it's a matter of taste. Take python for example. You can construct quite complex parsers, but it's verbose. Still way better than what you need to do in bash. On the other end of the spectrum, we have something like Raku, which does everything for you automagically, but robs you of certain freedoms, it also doesn't really follow the default unix-conventions, if I recall correctly, I'm not sure though. I think ideal would be some sort of DSL that allows for absolute minimal syntax for the common cases, and still allows you to expand for more complex examples. E.g.: to just have boolean flags, argument flags, i.e. flags with additional value, and positional arguments you should have to write nearly nothing. To have modes (cargo build, cargo run), you should not need much more. To restrict the valid values, to add help-strings or to have flags with multiple arguments, you could then use more elaborate syntax.
https://lobste.rs/s/vw12iy/when_if_is_just_function#c_eyoih5