add --version to booh and booh-classifier
authorGuillaume Cottenceau <gcottenc@gmail.com>
Fri, 13 Jun 2008 09:47:47 +0000 (11:47 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Fri, 13 Jun 2008 09:47:47 +0000 (11:47 +0200)
bin/booh
bin/booh-classifier

index ce1f20e65a8d0cbd1912b03111b1d94000f92c7f..b9c62ff8b33caf2cfdd51c0255c1c7208d49bf76 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -42,9 +42,9 @@ require 'booh/Synchronizator'
 
 #- options
 $options = [
-    [ '--help',          '-h', GetoptLong::NO_ARGUMENT,       _("Get help message") ],
-
+    [ '--help',          '-h', GetoptLong::NO_ARGUMENT, _("Get help message") ],
     [ '--verbose-level', '-v', GetoptLong::REQUIRED_ARGUMENT, _("Set max verbosity level (0: errors, 1: warnings, 2: important messages, 3: other messages)") ],
+    [ '--version',       '-V', GetoptLong::NO_ARGUMENT, _("Print version and exit") ],
 ]
 
 #- default values for some globals 
@@ -72,6 +72,15 @@ def handle_options
                 usage
                 exit(0)
 
+            when '--version'
+                puts _("Booh version %s
+
+Copyright (c) 2005-2008 Guillaume Cottenceau.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.") % $VERSION
+
+                exit(0)
+
             when '--verbose-level'
                 $verbose_level = arg.to_i
 
index e7005ce444b63c81a958d2fcb4dc2d09b6baa27c..7ca3ed3aadf452373203559fa50dc7160e13e7c2 100755 (executable)
@@ -39,10 +39,10 @@ require 'booh/UndoHandler'
 
 #- options
 $options = [
-    [ '--help',          '-h', GetoptLong::NO_ARGUMENT,       _("Get help message") ],
-
-    [ '--verbose-level', '-v', GetoptLong::REQUIRED_ARGUMENT, _("Set max verbosity level (0: errors, 1: warnings, 2: important messages, 3: other messages)") ],
+    [ '--help',          '-h', GetoptLong::NO_ARGUMENT, _("Get help message") ],
     [ '--sort-by-exif-date', '-s', GetoptLong::NO_ARGUMENT, _("Sort entries by EXIF date") ],
+    [ '--verbose-level', '-v', GetoptLong::REQUIRED_ARGUMENT, _("Set max verbosity level (0: errors, 1: warnings, 2: important messages, 3: other messages)") ],
+    [ '--version',       '-V', GetoptLong::NO_ARGUMENT, _("Print version and exit") ],
 ]
 
 $preloader_allowed = false
@@ -64,11 +64,20 @@ def handle_options
                 usage
                 exit(0)
 
+            when '--sort-by-exif-date'
+                $sort_by_exif_date = true
+
             when '--verbose-level'
                 $verbose_level = arg.to_i
 
-            when '--sort-by-exif-date'
-                $sort_by_exif_date = true
+            when '--version'
+                puts _("Booh version %s
+
+Copyright (c) 2005-2008 Guillaume Cottenceau.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.") % $VERSION
+
+                exit(0)
 
             end
         end