diff options
author | B. Watson <yalhcru@gmail.com> | 2018-05-22 01:13:36 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2018-05-22 01:13:36 -0400 |
commit | 7244ed21737d14fe4589cf862f594e4ff82f7b40 (patch) | |
tree | 8ca35865dbf53b144ac188aae5dff42e31d31100 | |
parent | 84dd81caf1359ebc341c0e6a28caf54acd8f9f51 (diff) | |
download | sbostuff-7244ed21737d14fe4589cf862f594e4ff82f7b40.tar.gz |
Add --help option, show usage even if config file missing
-rwxr-xr-x | sbosrcarch | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -6,6 +6,10 @@ our $DEBUG_HTTP = 0; # TODO create_mode stats are wrong +# FIXME 20180522 bkw: check and status commands include old +# versions that haven't been purged in the total, so we get 112% +# coverage and -1034 missing files! + # FIXME 20151016 bkw: behold: # $ grep ^D libraries/p4api/*.info # DOWNLOAD="ftp://ftp.perforce.com/perforce/r10.1/bin.linux26x86/p4api.tgz" @@ -431,7 +435,8 @@ sub read_config { } else { die "can't find .sbosrcarch.conf or sbosrcarch.conf in any of the\n" . "following directories (and no -c option), giving up:\n" . - join ("\n", @configdirs) . "\n"; + join ("\n", @configdirs) . "\n" . + "\nTry 'sbosrcarch --help' or 'perldoc sbosrcarch' for help.\n"; } # required stuff in the conf file: @@ -1728,8 +1733,8 @@ EOF #main() $|++; +usage() unless (defined $ARGV[0] && $ARGV[0] !~ /^-/); read_config(); -usage() unless defined $ARGV[0]; for ($ARGV[0]) { /create/ && do { create_mode(); }; /update/ && do { update_mode(); }; |