NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.96k stars 1.54k forks source link

Use Case: piping output of --dry-run #2567

Open bendlas opened 5 years ago

bendlas commented 5 years ago

Issue Description

When the --dry-run is passed, it is often useful to pipe the its output into less or other tools. Currently, this requires a stderr redirection 2>&1.

Reproduction

nix-build "<nixpkgs>" -A blender --dry-run | wc -l

will print

these paths will be fetched (xx.xx MiB download, xxx.xx MiB unpacked):
  /nix/store/0j2r...-libXrandr-1.5.1
  <... cut ...>
0

which means, that wc has counted 0 lines

Proposal

Building this redirection right into --dry-run (i.e. having it write to stdout) shouldn't break any existing use cases, since it currently doesn't write anything to stdout.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

stale[bot] commented 2 years ago

I closed this issue due to inactivity. → More info