-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add -o
/ --output
option to rgbfix
to write separate output files
#1666
base: master
Are you sure you want to change the base?
Conversation
Hey jmillikin, thank you for this contribution! I'd like to know what @ISSOtm thinks of this feature. On the one hand, it can currently be done with If we do want to merge it, the man/rgbfix.1 docs and the contrib/*_compl files would also need updating. |
58450ef
to
3255762
Compare
Updated The build system I'm using (Bazel) is pretty strongly file-oriented, and doesn't make it easy to use stdin/stdout for communicating data to/from subprocesses. If invoking a shell manually there's issues of path quoting, so args = ["/bin/sh", "-c", "$1 - > $2 < $3", "sh", rgbfix.path, out_gb.path, in_gb.path], ... and frankly a desire to avoid that is what inspired the creation of this patch request. |
The problem with The problem with The proper fix is to write to e.g. Note that the “input file” problem is also solved by the above fix; and that RGBLINK and RGBFIX should be considered a single step (they are only separate programs so that RGBFIX can be reused externally... and there have been feature requests for making RGBLINK self-sufficient). |
Merging the execution of two separate binaries (
In this patch the output file is opened with |
This could be difficult, at least with the current v0.x CLIs, because rgblink and rgbfix each have a lot of flags already, and one program that does it all would get complicated. |
This allows
rgbfix
to be used from build systems that discourage or forbid in-place modification of input files in build steps.rgbfix foo.gb
andcat foo.gb | rgbfix
continue to work as-is.rgbfix foo.gb -o out.gb
opensfoo.gb
read-only and writes output toout.gb
-o
, such thatcat foo.gb | rgbfix -o out.gb
andrgbfix foo.gb -o - | cat > out.gb
work.