X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=bin%2Fmailshears;h=d9d16253cee734bba0428d64c0cbf07d036de669;hp=d285171b203144117600ca782db8462e51314fb4;hb=HEAD;hpb=df4e02ebf6a4e28a58abcb298a4442a245ad0b15 diff --git a/bin/mailshears b/bin/mailshears index d285171..6161d57 100755 --- a/bin/mailshears +++ b/bin/mailshears @@ -1,6 +1,6 @@ #!/usr/bin/ruby -wU # -# mailshears, to prune unused mail directories (and more). +# mailshears, to prune your mail garden # # Load all of our lib/ code. @@ -13,6 +13,14 @@ program_name = File.basename($PROGRAM_NAME) mode_name = 'prune' mode = :prune +# Before doing anything else, check for "-h" and "--help" in the args, +# because those should cause us to dump usage info and bail out. +if ARGV.include?('-h') or ARGV.include?('--help') then + puts "Usage: #{UserInterface.usage(program_name)}" + Kernel.exit(ExitCodes::SUCCESS) +end + + # If a mode was supplied, it should be in ARGV[0]. if ARGV.length() > 0 mode_names = ['prune', 'rm', 'mv']