about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nix/path-info.cc10
-rw-r--r--src/nix/sigs.cc31
2 files changed, 10 insertions, 31 deletions
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index d144ef082977..9347795f1cb9 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -12,11 +12,13 @@ struct CmdPathInfo : StorePathsCommand
 {
     bool showSize = false;
     bool showClosureSize = false;
+    bool showSigs = false;
 
     CmdPathInfo()
     {
         mkFlag('s', "size", "print size of the NAR dump of each path", &showSize);
         mkFlag('S', "closure-size", "print sum size of the NAR dumps of the closure of each path", &showClosureSize);
+        mkFlag(0, "sigs", "show signatures", &showSigs);
     }
 
     std::string name() override
@@ -68,6 +70,14 @@ struct CmdPathInfo : StorePathsCommand
                 std::cout << '\t' << std::setw(11) << totalSize;
             }
 
+            if (showSigs) {
+                std::cout << '\t';
+                Strings ss;
+                if (info->ultimate) ss.push_back("ultimate");
+                for (auto & sig : info->sigs) ss.push_back(sig);
+                std::cout << concatStringsSep(" ", ss);
+            }
+
             std::cout << std::endl;
         }
     }
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 6cff5a084dec..56f7d221363a 100644
--- a/src/nix/sigs.cc
+++ b/src/nix/sigs.cc
@@ -103,37 +103,6 @@ struct CmdCopySigs : StorePathsCommand
 
 static RegisterCommand r1(make_ref<CmdCopySigs>());
 
-struct CmdQueryPathSigs : StorePathsCommand
-{
-    CmdQueryPathSigs()
-    {
-    }
-
-    std::string name() override
-    {
-        return "query-path-sigs";
-    }
-
-    std::string description() override
-    {
-        return "print store path signatures";
-    }
-
-    void run(ref<Store> store, Paths storePaths) override
-    {
-        for (auto & storePath : storePaths) {
-            auto info = store->queryPathInfo(storePath);
-            std::cout << storePath << " ";
-            if (info->ultimate) std::cout << "ultimate ";
-            for (auto & sig : info->sigs)
-                std::cout << sig << " ";
-            std::cout << "\n";
-        }
-    }
-};
-
-static RegisterCommand r2(make_ref<CmdQueryPathSigs>());
-
 struct CmdSignPaths : StorePathsCommand
 {
     Path secretKeyFile;