From 7244ed21737d14fe4589cf862f594e4ff82f7b40 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 22 May 2018 01:13:36 -0400 Subject: Add --help option, show usage even if config file missing --- sbosrcarch | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbosrcarch b/sbosrcarch index 5616471..ea74f43 100755 --- a/sbosrcarch +++ b/sbosrcarch @@ -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(); }; -- cgit v1.2.3