aboutsummaryrefslogtreecommitdiff
path: root/src/nix/cat.cc
AgeCommit message (Collapse)Author
2024-07-01tree-wide: unify progress bar inactive and paused statesAlois Wohlschlager
Previously, the progress bar had two subtly different states in which the bar would not actually render, both with their own shortcomings: inactive (which was irreversible) and paused (reversible, but swallowing logs). Furthermore, there was no way of resetting the statistics, so a very bad solution was implemented (243c0f18dae2a08ea0e46f7ff33277c63f7506d7) that would create a new logger for each line of the repl, leaking the previous one and discarding the value of printBuildLogs. Finally, if stderr was not attached to a TTY, the update thread was started even though the logger was not active, violating the invariant required by the destructor (which is not observed because the logger is leaked). In this commit, the two aforementioned states are unified into a single one, which can be exited again, correctly upholds the invariant that the update thread is only running while the progress bar is active, and does not swallow logs. The latter change in behavior is not expected to be a problems in the rare cases where the paused state was used before, since other loggers (like the simple one) don't exhibit it anyway. The startProgressBar/stopProgressBar API is removed due to being a footgun, and a new method for properly resetting the progress is added. Co-Authored-By: Qyriad <qyriad@qyriad.me> Change-Id: I2b7c3eb17d439cd0c16f7b896cfb61239ac7ff3a
2024-05-18nix cat/dump-path/key: stop progress bar before writeFullPuck Meerburg
These commands outputs data that may not end with a newline. This causes problems when the progress bar redraws, as that completely wipes the last line of output. As nix key generate-secret outputs a single line of text with no output, it shows up entirely blank, making it look like nothing happened. Fixes: https://git.lix.systems/lix-project/lix/issues/320 Change-Id: I5ac706d71d839b6dfa760b60a351414cd96297cf
2023-03-02nix store cat: Use writeFull()Eelco Dolstra
Fixes #7939.
2022-01-18Get rid of std::shared_ptr<std::string> and ref<std::string>Eelco Dolstra
These were needed back in the pre-C++11 era because we didn't have move semantics. But now we do.
2020-12-21Add 'nix store' NAR-related manpagesEelco Dolstra
2020-12-21Add 'nix nar' manpagesEelco Dolstra
2020-12-03Move most store-related commands to 'nix store'Eelco Dolstra
2020-12-03Move NAR-related commands to 'nix nar'Eelco Dolstra
2020-10-06Remove static variable name clashesEelco Dolstra
This was useful for an experiment with building Nix as a single compilation unit. It's not very useful otherwise but also doesn't hurt...
2020-06-17Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-05-11Merge branch 'master' into errors-phase-2Ben Burdette
2020-05-11CleanupEelco Dolstra
2020-05-10Add completion for pathsEelco Dolstra
2020-05-05nix --help: Group commandsEelco Dolstra
2020-04-21remove 'format' from Error constructor callsBen Burdette
2019-12-05Make subcommand construction in MultiCommand lazyEelco Dolstra
(cherry picked from commit a0de58f471c9087d8e6cc60a6078f9940a125b15)
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2016-11-26Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25Get rid of unicode quotes (#1140)Guillaume Maudoux
2016-02-25nix: Add commands to query contents of NARs / binary cachesEelco Dolstra
For example, $ NIX_REMOTE=file:///my-cache nix ls-store -lR /nix/store/f4kbgl8shhyy76rkk3nbxr0lz8d2ip7q-binutils-2.23.1 dr-xr-xr-x 0 ./bin -r-xr-xr-x 30748 ./bin/addr2line -r-xr-xr-x 66973 ./bin/ar ... Similarly, "nix ls-nar" lists the contents of a NAR file, "nix cat-nar" extracts a file from a NAR file, and "nix cat-store" extract a file from a Nix store.