# HG changeset patch # User Steve Kemp # Date 1213822696 -3600 # Node ID 389f234d4111746ae2890c6df928fa28fe24b004 # Parent 5ea9f2d8bd8e28ea59172401bab91d05f37d1c2e Failure to parse options should make the script exit diff -r 5ea9f2d8bd8e -r 389f234d4111 bin/chronicle --- a/bin/chronicle Tue Jun 03 21:48:39 2008 +0100 +++ b/bin/chronicle Wed Jun 18 21:58:16 2008 +0100 @@ -514,50 +514,55 @@ # # Parse options. # - GetOptions( - - # Help options - "help", \$HELP, - "manual", \$MANUAL, - "verbose", \$CONFIG{ 'verbose' }, - "version", \$VERSION, - "list-themes", \$CONFIG{ 'list-themes' }, - - # paths - "comments=s", \$CONFIG{ 'comments' }, - "config=s", \$CONFIG{ 'config' }, - "input=s", \$CONFIG{ 'input' }, - "output=s", \$CONFIG{ 'output' }, - "theme-dir=s", \$CONFIG{ 'theme-dir' }, - "theme=s", \$CONFIG{ 'theme' }, - "pattern=s", \$CONFIG{ 'pattern' }, - - # optional - "force", \$CONFIG{ 'force' }, - "no-tags", \$CONFIG{ 'no-tags' }, - "no-cache", \$CONFIG{ 'no-cache' }, - "no-calendar", \$CONFIG{ 'no-calendar' }, - "no-comments", \$CONFIG{ 'no-comments' }, - "no-archive", \$CONFIG{ 'no-archive' }, - "lower-case", \$CONFIG{ 'lower-case' }, - "comment-days=s", \$CONFIG{ 'comment-days' }, - - # input format. - "format=s", \$CONFIG{ 'format' }, - - # prefix - "url-prefix=s", \$CONFIG{ 'url_prefix' }, - - # commands - "pre-build=s", \$CONFIG{ 'pre-build' }, - "post-build=s", \$CONFIG{ 'post-build' }, - - # title - "blog-title=s", \$CONFIG{ 'blog_title' }, - "blog-subtitle=s", \$CONFIG{ 'blog_subtitle' }, - - - ); + if ( + !GetOptions( + + # Help options + "help", \$HELP, + "manual", \$MANUAL, + "verbose", \$CONFIG{ 'verbose' }, + "version", \$VERSION, + "list-themes", \$CONFIG{ 'list-themes' }, + + # paths + "comments=s", \$CONFIG{ 'comments' }, + "config=s", \$CONFIG{ 'config' }, + "input=s", \$CONFIG{ 'input' }, + "output=s", \$CONFIG{ 'output' }, + "theme-dir=s", \$CONFIG{ 'theme-dir' }, + "theme=s", \$CONFIG{ 'theme' }, + "pattern=s", \$CONFIG{ 'pattern' }, + + # optional + "force", \$CONFIG{ 'force' }, + "no-tags", \$CONFIG{ 'no-tags' }, + "no-cache", \$CONFIG{ 'no-cache' }, + "no-calendar", \$CONFIG{ 'no-calendar' }, + "no-comments", \$CONFIG{ 'no-comments' }, + "no-archive", \$CONFIG{ 'no-archive' }, + "lower-case", \$CONFIG{ 'lower-case' }, + "comment-days=s", \$CONFIG{ 'comment-days' }, + + # input format. + "format=s", \$CONFIG{ 'format' }, + + # prefix + "url-prefix=s", \$CONFIG{ 'url_prefix' }, + + # commands + "pre-build=s", \$CONFIG{ 'pre-build' }, + "post-build=s", \$CONFIG{ 'post-build' }, + + # title + "blog-title=s", \$CONFIG{ 'blog_title' }, + "blog-subtitle=s", \$CONFIG{ 'blog_subtitle' }, + + + ) + ) + { + exit; + } pod2usage(1) if $HELP; pod2usage( -verbose => 2 ) if $MANUAL; diff -r 5ea9f2d8bd8e -r 389f234d4111 bin/chronicle-rss-importer --- a/bin/chronicle-rss-importer Tue Jun 03 21:48:39 2008 +0100 +++ b/bin/chronicle-rss-importer Wed Jun 18 21:58:16 2008 +0100 @@ -62,13 +62,17 @@ sub parseCommandLineArguments { - GetOptions( + if ( + !GetOptions( - # Help options - "feed=s", \$CONFIG{ 'feed' }, - "output=s", \$CONFIG{ 'output' }, - "sequential", \$CONFIG{ 'sequential' }, - ); + "feed=s", \$CONFIG{ 'feed' }, + "output=s", \$CONFIG{ 'output' }, + "sequential", \$CONFIG{ 'sequential' }, + ) + ) + { + exit; + } } diff -r 5ea9f2d8bd8e -r 389f234d4111 bin/chronicle-spooler --- a/bin/chronicle-spooler Tue Jun 03 21:48:39 2008 +0100 +++ b/bin/chronicle-spooler Wed Jun 18 21:58:16 2008 +0100 @@ -204,25 +204,30 @@ # # Parse options. # - GetOptions( + if ( + !GetOptions( - # input / output - "spool-dir=s", \$CONFIG{ 'spool-dir' }, - "live-dir=s", \$CONFIG{ 'live-dir' }, + # input / output + "spool-dir=s", \$CONFIG{ 'spool-dir' }, + "live-dir=s", \$CONFIG{ 'live-dir' }, - # testing? - "test", \$CONFIG{ 'test' }, + # testing? + "test", \$CONFIG{ 'test' }, - # command? - "post-move=s", \$CONFIG{ 'post-move' }, + # command? + "post-move=s", \$CONFIG{ 'post-move' }, - # Help options - "help", \$HELP, - "manual", \$MANUAL, - "verbose", \$CONFIG{ 'verbose' }, - "version", \$VERSION, + # Help options + "help", \$HELP, + "manual", \$MANUAL, + "verbose", \$CONFIG{ 'verbose' }, + "version", \$VERSION, - ); + ) + ) + { + exit; + } pod2usage(1) if $HELP; pod2usage( -verbose => 2 ) if $MANUAL;