s
didn't work because the argv[0]
you replaced later in the program wasn't the program name but an iterating pointer.
Instead of opts
here I would call this a variant of arg
. opts
is a little misleading; this is used for all given arguments, not just parsed options.
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.