]> www.average.org Git - mkgallery.git/commitdiff
add --help option
authorEugene Crosser <crosser@average.org>
Sun, 17 Dec 2006 09:39:01 +0000 (09:39 +0000)
committerEugene Crosser <crosser@average.org>
Sun, 17 Dec 2006 09:39:01 +0000 (09:39 +0000)
README
mkgallery.pl

diff --git a/README b/README
index b6cb4ccdc343dbc74c6fcfc1b8f714f9c4f91112..7f8b7ed9b0c47552e684474e2d9b3fc1224fd0fb 100644 (file)
--- a/README
+++ b/README
@@ -41,7 +41,8 @@ there.  This way you can preserve index created by hand or by some other
 script like "mkindex.pl".
 
 command-line options:
- --incpath:     do not try to fine .include diretory upstream, use
+ --help:       print help message and exit
+ --incpath:    do not try to find .include diretory upstream, use
                specified path (absolute or relavive).  Use with causion.
  --debug:      print a lot of debugging info to stdout as you run
  --asktitle:   ask to edit album titles even if there are ".title" files
index 1a3688439edf8acf58a7d031b90c9bf85b4f9974..5c02e0b83995e8fbbe765854689865f2e67603d2 100755 (executable)
@@ -51,15 +51,35 @@ my $noasktitle = 0;
 
 charset("utf-8");
 
-GetOptions(    'incpath'=>\$incpath,
+unless (GetOptions(
+               'help'=>\&help,
+               'incpath'=>\$incpath,
                'asktitle'=>\$asktitle,
                'noasktitle'=>\$noasktitle,
-               'debug'=>\$debug);
+               'debug'=>\$debug)) {
+       &help;
+}
 
 my $term = new Term::ReadLine "Edit Title";
 
 FsObj->new(getcwd)->iterate;
 
+sub help {
+
+       print STDERR <<__END__;
+usage: $0 [options]
+ --help:        print help message and exit
+ --incpath:     do not try to find .include diretory upstream, use
+                specified path (absolute or relavive).  Use with causion.
+ --debug:       print a lot of debugging info to stdout as you run
+ --asktitle:    ask to edit album titles even if there are ".title" files
+ --noasktitle:  don't ask to enter album titles even where ".title"
+                files are absent.  Use partial directory names as titles.
+__END__
+
+       exit 1;
+}
+
 sub new {
        my $this = shift;
        my $class;