Open syxolk opened 7 years ago
Hm, a couple of points:
piping
branch.--stdin
flag?-t/--to
and -f/--from
flags as in pandoc
instead of -o
. The latter does not have a 'from' or 'input' counterpart, does it?Apart from this: I find the multi-nesting if-else if-else branches really clumsy and un-elegant. Do you know a fancy pattern for this? The only thing I can think of is matching on tuples:
match (flag_a, flag_b, flag c) {
(true, false, false) => foo(),
(false, true, false) => bar(),
_ => (), // invalid combination
}
Thinking about it: Why not --to-stdout
and --from-stdin
flags? I'd rather type 10 chars more than have inconsistent and ad-hoc flags/commands (like git
, unfortunately).
main.rs
.--from
would not be easily backwards-compatible.Ok, I'll take a look at it today!
Currently we have this:
indentex [DIRECTORY]
indentex [FILE]
What I want to add:
indentex [FILE] --stdout
(write to stdout)indentex -o [OUTFILE]
(read from stdin)indentex --stdout
(read from stdin and write to stdout)indentex [FILE] -o [OUTFILE]
(no piping at all; just here for consistency)It's a bit weird to have the
--stdout
in the first place but I don't see any other way to stay compatible.