]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- make class OutputOptions reusable 941/head
authorArvin Schnell <aschnell@suse.de>
Tue, 8 Oct 2024 09:24:16 +0000 (11:24 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 8 Oct 2024 09:24:16 +0000 (11:24 +0200)
client/snapper/cmd-list.cc
client/utils/Makefile.am
client/utils/OutputOptions.h [new file with mode: 0644]

index acb1cd7fee081510a85b29ce46d8a0d7c65b5373..b00f4a302953a4d1c99d21e20d2ae19acd8cf2f0 100644 (file)
@@ -38,6 +38,7 @@
 #include "../utils/TableFormatter.h"
 #include "../utils/CsvFormatter.h"
 #include "../utils/JsonFormatter.h"
+#include "../utils/OutputOptions.h"
 #include "dbus/DBusMessage.h"
 #include "../utils/HumanString.h"
 
@@ -77,24 +78,6 @@ namespace snapper
        enum class ListMode { ALL, SINGLE, PRE_POST };
 
 
-       /**
-        * Just a collection of some variables defining the output.
-        */
-       class OutputOptions
-       {
-       public:
-
-           OutputOptions(bool utc, bool iso, bool human)
-               : utc(utc), iso(iso), human(human)
-           {
-           }
-
-           const bool utc;
-           const bool iso;
-           const bool human;
-       };
-
-
        /**
         * Some help for the output, e.g. check if a snapshot is the default or active
         * snapshot, check if a snapshot should be skipped in the output or check if the
index e6a99680a6b7b6d2238005f2d0bc33289cc9cc81..a872192fcf2bc9391f92276898ef3047045c821e 100644 (file)
@@ -18,6 +18,7 @@ libutils_la_SOURCES =                                 \
        Limit.cc                Limit.h                 \
        TableFormatter.cc       TableFormatter.h        \
        CsvFormatter.cc         CsvFormatter.h          \
-       JsonFormatter.cc        JsonFormatter.h
+       JsonFormatter.cc        JsonFormatter.h         \
+       OutputOptions.h
 
 libutils_la_LIBADD = ../../snapper/libsnapper.la -ltinfo
diff --git a/client/utils/OutputOptions.h b/client/utils/OutputOptions.h
new file mode 100644 (file)
index 0000000..fccb1c7
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) [2011-2015] Novell, Inc.
+ * Copyright (c) [2016-2024] SUSE LLC
+ *
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
+ * find current contact information at www.novell.com.
+ */
+
+
+namespace snapper
+{
+
+    /**
+     * Just a collection of some variables defining the output.
+     */
+    class OutputOptions
+    {
+    public:
+
+       OutputOptions(bool utc, bool iso, bool human)
+           : utc(utc), iso(iso), human(human)
+       {
+       }
+
+       const bool utc;
+       const bool iso;
+       const bool human;
+
+    };
+
+}