]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Output state and date for CmdMetaParse
authorCheng-Ling Lai <jameslai.tech@gmail.com>
Wed, 5 Aug 2026 06:10:37 +0000 (14:10 +0800)
committerCheng-Ling Lai <jameslai.tech@gmail.com>
Wed, 5 Aug 2026 06:10:37 +0000 (14:10 +0800)
client/snbk/CmdMetaParse.cc
client/snbk/CmdMetaParse.h

index d72d48690d83cd7bd68d899d70dd4bff680520cf..f62b333b137a6e00de3b1dcc400415f4b9738d58 100644 (file)
@@ -40,6 +40,9 @@
 
 namespace snapper
 {
+    const vector<string> EnumInfo<SnapshotMeta::State>::names({ "invalid", "valid" });
+
+
     CmdMetaParse::CmdMetaParse(const Shell& shell, const string& snapshot_dir,
                                const string& cat_bin)
         : path(snapshot_dir + "/info.xml")
@@ -142,6 +145,7 @@ namespace snapper
        SnapshotMeta meta = cmd_metaparse.get_meta();
        s << "path: " << cmd_metaparse.path
          << ", checksum: " << cmd_metaparse.get_checksum()
+         << ", state: " << toString(meta.state) << ", date: " << meta.date
          << ", type: " << toString(meta.type) << ", pre_num: " << meta.pre_num
          << ", cleanup: " << meta.cleanup
          << ", userdata: " << show_userdata(meta.userdata) << '\n';
index d5cc8e6592981d60c74d6788a92c769358af3890..68a2977ce46fa516cb03d09d736173808f0975cd 100644 (file)
@@ -24,6 +24,7 @@
 #define SNAPPER_CMD_METAPARSE_H
 
 
+#include <snapper/Enum.h>
 #include <snapper/Snapshot.h>
 
 #include "Shell.h"
@@ -64,6 +65,12 @@ namespace snapper
     };
 
 
+    template <> struct EnumInfo<SnapshotMeta::State>
+    {
+       static const vector<string> names;
+    };
+
+
     class CmdMetaParse
     {
     public: