Skip to content
Snippets Groups Projects
Commit 5f2f6429 authored by Nick Bearson's avatar Nick Bearson
Browse files

make our help text return the name of the script that was actually called

parent bef47676
No related branches found
No related tags found
1 merge request!8make our help text return the name of the script that was actually called
......@@ -29,4 +29,5 @@ fi
source $CSPP_GEO_GGLM_HOME/libexec/env.sh
# Call the python module to do the processing, passing all arguments
export PROG_NAME="${BASH_SOURCE[0]}"
python3 $CSPP_GEO_GGLM_HOME/libexec/_make_glm_grids.py "$@"
......@@ -29,4 +29,5 @@ fi
source $CSPP_GEO_GGLM_HOME/libexec/env.sh
# Call the python module to do the processing, passing all arguments
export PROG_NAME="${BASH_SOURCE[0]}"
python3 $CSPP_GEO_GGLM_HOME/libexec/_minute_gridder.py "$@"
......@@ -2,6 +2,7 @@
# This example was provided by GLMTools
# https://github.com/deeplycloudy/glmtools/blob/master/examples/grid/make_GLM_grids.py
import argparse
import sys
parse_desc = """Grid GLM flash data. The start and end times can be specified
independently, or if not provided they will be inferred from the filenames.
......@@ -24,7 +25,8 @@ structure by specifying a path like so: -o
{start_time:%%Y/%%b/%%d}/{dataset_name}"""
def create_parser():
parser = argparse.ArgumentParser(description=parse_desc)
prog = os.getenv('PROG_NAME', sys.argv[0])
parser = argparse.ArgumentParser(prog=prog, description=parse_desc)
parser.add_argument(dest='filenames',metavar='filename', nargs='*')
parser.add_argument('-o', '--output_path',
metavar='filename template including path',
......
......@@ -3,8 +3,9 @@
parse_desc = """Create one minute NetCDF4 grids (and, optionally, AWIPS-compatible tiles) from GLM flash data.
Example usage:\n
cspp-geo-gglm.sh \\
Example usage:
%(prog)s \\
--goes-sector conus \\
--create-tiles \\
-vv \\
......@@ -37,7 +38,10 @@ log = logging.getLogger(__name__)
def create_parser():
import argparse
parser = argparse.ArgumentParser(description=parse_desc, formatter_class=argparse.RawTextHelpFormatter) # RawTextHelpFormatter preserves our newlines in the example usage message
prog = os.getenv('PROG_NAME', sys.argv[0])
parser = argparse.ArgumentParser(prog=prog,
description=parse_desc,
formatter_class=argparse.RawTextHelpFormatter) # RawTextHelpFormatter preserves our newlines in the example usage message
parser.add_argument('-v', '--verbose', dest='verbosity', action="count", default=0,
help="each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG\n"
"(default: ERROR)")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment