diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-04-19 14:19:46 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-04-19 14:19:46 +0200 |
commit | 50ec2bed9edd234eabbd4a3920052ca2f94bca52 (patch) | |
tree | 09f08f14cedc021966b071ce3c3f1dd984fab173 /src | |
parent | bc259192b4e1f90c575ddc83814b82cca829a4f8 (diff) |
nix flake info: Show revcount
Diffstat (limited to 'src')
-rw-r--r-- | src/nix/flake.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc index 34d67ee58..eec280584 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -44,6 +44,8 @@ void printFlakeInfo(Flake & flake, bool json) { j["description"] = flake.description; if (flake.sourceInfo.rev) j["revision"] = flake.sourceInfo.rev->to_string(Base16, false); + if (flake.sourceInfo.revCount) + j["revCount"] = *flake.sourceInfo.revCount; j["path"] = flake.sourceInfo.storePath; std::cout << j.dump(4) << std::endl; } else { @@ -52,6 +54,8 @@ void printFlakeInfo(Flake & flake, bool json) { std::cout << "Description: " << flake.description << "\n"; if (flake.sourceInfo.rev) std::cout << "Revision: " << flake.sourceInfo.rev->to_string(Base16, false) << "\n"; + if (flake.sourceInfo.revCount) + std::cout << "Revcount: " << *flake.sourceInfo.revCount << "\n"; std::cout << "Path: " << flake.sourceInfo.storePath << "\n"; } } |