diff --git a/xlslu.py b/xlslu.py index 0ff8493..f8fd423 100755 --- a/xlslu.py +++ b/xlslu.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -# xlslu.py - Match Strings In XLS Spreadsheets +# xlslu.py - Simple Excel Spreadsheet String Search # Embed the source control ID string for use by program +# Copyright (c) 2013-2020 TundraWare Inc. -CVSID='$Id: xlslu.py,v 1.201 $' ##### # Program Information @@ -10,7 +10,7 @@ PROGNAME = "xlslu.py" PROGENV = "xlslu".upper() -VERSION = CVSID.split()[2] +VERSION = "1.201" PROGVER = PROGNAME + " " + VERSION + " - Match Strings In XLS Spreadsheets" @@ -120,7 +120,7 @@ " where,", " -a require all strings to be present (AND matching)", " -h print this help information", - " -v print detailed version information", + " -v print version information", " file.xls name of spreadsheet file to read", " string ... list of strings that will trigger a match", ] @@ -246,7 +246,16 @@ # Command line processing - Process any options set in the # environment first, and then those given on the command line -OPTIONS = sys.argv[1:] +# They at least have to provide a filename +# Does not catch the case where they provide an option but no filename + +if len(sys.argv) < 2: + Usage() + sys.exit(1) + +else: + OPTIONS = sys.argv[1:] + envopt = os.getenv(PROGENV) if envopt: OPTIONS = envopt.split() + OPTIONS @@ -257,7 +266,6 @@ except getopt.GetoptError as cli_errors: (errmsg, badarg) = cli_errors.args - ErrorMsg(eBADARG % errmsg) sys.exit(1) @@ -271,7 +279,7 @@ sys.exit(0) if opt == "-v": - PrintStdout(CVSID) + PrintStdout(PROGVER) sys.exit(0) SPREADSHEET = args[0]