]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- cleaner code 70/head
authorArvin Schnell <aschnell@suse.de>
Thu, 10 Apr 2014 16:05:52 +0000 (18:05 +0200)
committerArvin Schnell <aschnell@suse.de>
Thu, 10 Apr 2014 16:05:52 +0000 (18:05 +0200)
client/snapper.cc
client/utils/Table.h

index d2276329fe4fa6430a1ab18138c3b8bf78e79380..82beab91770ce7c7b441b3a900bb6081c1f97073 100644 (file)
@@ -1529,10 +1529,10 @@ main(int argc, char** argv)
     {
        unsigned int s;
        opt->second >> s;
-       if (s >= _End)
+       if (s >= Table::numStyles)
        {
            cerr << sformat(_("Invalid table style %d."), s) << " "
-                << sformat(_("Use an integer number from %d to %d"), 0, _End - 1) << endl;
+                << sformat(_("Use an integer number from %d to %d."), 0, Table::numStyles - 1) << endl;
            exit(EXIT_FAILURE);
        }
        Table::defaultStyle = (TableLineStyle) s;
index e4a30bb886b897c2fa263441d4968e21adc235d5..f4733aa21340dcc08cbddf1d213afec6038fb777 100644 (file)
@@ -14,6 +14,7 @@
 #include <iosfwd>
 #include <list>
 #include <vector>
+
 using std::string;
 using std::ostream;
 using std::list;
@@ -91,6 +92,8 @@ public:
 
   static TableLineStyle defaultStyle;
 
+  static const unsigned int numStyles = _End;
+
   void add (const TableRow& tr);
   void setHeader (const TableHeader& tr);
   void dumpTo (ostream& stream) const;