I'm not partial to either matching or using the clojure, but I think it should be consistent between programs.
Emma: you told me that returning from main here would be impossible from a clojure. Would it be better to match the Result here to facilitate that?
Instead of marking that this is to set the delimiter, I'd prefer a more descriptive name for the variable d
(like delimiter
). I'd also prefer:
I can't find a way to rewrite this in Rust without vendoring a crate or writing termios C bindings.
I would put this in the same block as getopt(3p) to reduce cognitive load; That One Block is where arguments are interpreted.
The compiler will filter this if down to one condition anyway. Why are there two here? argc==0
isn't a special case with regards to intcmp(1), except that the program_name
fallback needs to be used.