Closed matthias314 closed 1 month ago
Thanks for trying out Runic. The command line parsing is a bit of a mess sorry.
Would it make sense to send output to stdout by default?
I think I had this at first but it is a bit annoying if you do runic
and it seemingly just hangs but I suppose that is how many unix tools work. Perhaps it is possible to detect what type stdin have and bail after a while if there is no input.
runic -o test.out test.jl
This one should definitely work.
runic -d test.jl
This one should probably also work and simply print the diff to stderr? (Or stdout since formatted text isn't outputted?)
runic -o test.out -d test.jl
This one I think works as expected. The formatted text is outputted to test.out
and auxiliary information like the diff to stderr. It doesn't make sense to output them both to the file I think?
runic -o - -d test.jl
Hmm, this should work and output formatted text to stdout and diff to stderr.
Would it make sense to send output to stdout by default?
I suppose that is how many unix tools work.
I agree.
runic -d test.jl
This one should probably also work and simply print the diff to stderr?
The error message given for runic test.jl
suggests that with a single -d
option it works. So it should work (or the error message should be changed). If the output went to stdout
by default, then this would apply here, too.
runic -o test.out -d test.jl
This one I think works as expected. The formatted text is outputted to test.out and auxiliary information like the diff to stderr. It doesn't make sense to output them both to the file I think?
I see, it's stderr
, not stdout
. I didn't expect any output outside of the specified output file. Again, that would be how Unix tools work. If you use runic
in a script, then you probably want it to do its job silently.
BTW, the long form of runic -o test.out
is runic --output test.out
. It seems to me that the (GNU?) convention for long options is to use a =
sign, for example, grep -f test
becomes grep --file=test
. Also compare julia --project=.
.
I didn't expect any output outside of the specified output file. Again, that would be how Unix tools work.
Logging info and verbose extra stuff is usually still printed to stderr though because you don't want that to garble up the "real output" which in this case is the formatted text.
Reworked the argument parsing a bit and also now stdin/stdout are defaults.
I get unexpected results when using the command-line options mentioned in the man page.
So far, so good. (Would it make sense to send output to
stdout
by default?)Why is this? I gave the option
-o
.Why is this? I gave the option
-d
.The output goes to both
test.out
andstdout
althoughstdout
was not specified. Why is this?This sends output to both
stdout
and the file./-
. However, the man page says: