Skip to content

Commit

Permalink
update usage statement to include METplus version number
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Jun 11, 2024
1 parent 160e2a5 commit 48cf20c
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions ush/run_metplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import produtil.setup

from metplus.util import pre_run_setup, run_metplus, post_run_cleanup
from metplus import __version__ as metplus_version

'''!@namespace run_metplus
Main script the processes all the tasks in the PROCESS_LIST
Expand Down Expand Up @@ -57,15 +58,12 @@ def main():

def usage():
"""!How to call this script."""
print ('''
Usage: %s arg1 arg2 arg3
-h|--help Display this usage statement
Arguments:
/path/to/parmfile.conf -- Specify custom configuration file to use
section.option=value -- override conf options on the command line
'''%(basename(__file__)))
print(f"Running METplus v{metplus_version}\n"
f"Usage: {basename(__file__)} arg1 arg2 arg3\n"
" -h|--help Display this usage statement\n\n"
"Arguments:\n"
"/path/to/parmfile.conf -- Specify custom configuration file to use\n"
"section.option=value -- override conf options on the command line")
sys.exit(2)


Expand All @@ -83,9 +81,8 @@ def get_config_inputs_from_command_line():

# print usage statement and exit if help arg is found
help_args = ('-h', '--help', '-help')
for help_arg in help_args:
if help_arg in sys.argv:
usage()
if any(arg in sys.argv for arg in help_args):
usage()

# pull out command line arguments
config_inputs = []
Expand Down

0 comments on commit 48cf20c

Please sign in to comment.