]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- added option for table style
authorArvin Schnell <aschnell@suse.de>
Wed, 9 Feb 2011 09:29:16 +0000 (10:29 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 9 Feb 2011 09:29:16 +0000 (10:29 +0100)
tools/snapper.cc

index 34ee70e0843192423ea12d48a06905807b5e24bf..b772b6638991724e2b96342915a54ad3c9de286e 100644 (file)
@@ -258,6 +258,7 @@ main(int argc, char** argv)
 
     const struct option options[] = {
        { "quiet",              no_argument,            0,      'q' },
+       { "table-style",        required_argument,      0,      's' },
        { 0, 0, 0, 0 }
     };
 
@@ -282,6 +283,19 @@ main(int argc, char** argv)
     if ((it = opts.find("quiet")) != opts.end())
        quiet = true;
 
+    if ((it = opts.find("table-style")) != opts.end())
+    {
+       unsigned int s;
+       it->second >> s;
+       if (s >= _End)
+       {
+           cerr << sformat(_("Invalid table style %d."), s) << " "
+                << sformat(_("Use an integer number from %d to %d"), 0, _End - 1) << endl;
+           exit(EXIT_FAILURE);
+       }
+       Table::defaultStyle = (TableLineStyle) s;
+    }
+
     sh = createSnapper();
 
     if (!quiet)