diff options
Diffstat (limited to 'users')
-rw-r--r-- | users/Profpatsch/lib.nix | 14 | ||||
-rw-r--r-- | users/Profpatsch/netencode/default.nix | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/users/Profpatsch/lib.nix b/users/Profpatsch/lib.nix index db81c2dfe321..1e9652a27986 100644 --- a/users/Profpatsch/lib.nix +++ b/users/Profpatsch/lib.nix @@ -21,6 +21,19 @@ let "pipeline" [ bins.multitee "0-1,2" ] "$@" ]; + eprint-stdin-netencode = depot.nix.writeExecline "eprint-stdin-netencode" {} [ + "pipeline" [ + # move stdout to 3 + "fdmove" "3" "1" + # the multitee copies stdin to 1 (the other pipeline end) and 3 (the stdout of the outer pipeline block) + "pipeline" [ bins.multitee "0-1,3" ] + # make stderr the stdout of pretty, merging with the stderr of pretty + "fdmove" "-c" "1" "2" + depot.users.Profpatsch.netencode.pretty + ] + "$@" + ]; + eprintenv = depot.nix.writeExecline "eprintenv" { readNArgs = 1; } [ "ifelse" [ "fdmove" "-c" "1" "2" bins.printenv "$1" ] [ "$@" ] @@ -43,6 +56,7 @@ in { debugExec eprintf eprint-stdin + eprint-stdin-netencode eprintenv runInEmptyEnv ; diff --git a/users/Profpatsch/netencode/default.nix b/users/Profpatsch/netencode/default.nix index 843408941d82..33209276f92f 100644 --- a/users/Profpatsch/netencode/default.nix +++ b/users/Profpatsch/netencode/default.nix @@ -38,12 +38,12 @@ let extern crate exec_helpers; fn main() { - let (_, prog) = exec_helpers::args_for_exec("eprint-stdin-netencode", 0); + let (_, prog) = exec_helpers::args_for_exec("netencode-pretty", 0); let mut buf = vec![]; - let u = netencode::u_from_stdin_or_die_user_error("eprint-stdin-netencode", &mut buf); + let u = netencode::u_from_stdin_or_die_user_error("netencode-pretty", &mut buf); match netencode_pretty::Pretty::from_u(u).print_multiline(&mut std::io::stdout()) { Ok(()) => {}, - Err(err) => exec_helpers::die_temporary("eprint-stdin-netencode", format!("could not write to stdout: {}", err)) + Err(err) => exec_helpers::die_temporary("netencode-pretty", format!("could not write to stdout: {}", err)) } } ''; |