Skip to content

Commit

Permalink
Add comment explaining argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrost-mo committed Dec 12, 2024
1 parent 2b2b0ee commit faef359
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CSET/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ def main(raw_cli_args: list[str] = sys.argv):
Handles argument parsing, setting up logging, top level error capturing,
and execution of the desired subcommand.
"""
# Read arguments from the command line and CSET_ADDOPTS environment variable
# into an args object.
parser = setup_argument_parser()
cli_args = raw_cli_args[1:] + shlex.split(os.getenv("CSET_ADDOPTS", ""))
args, unparsed_args = parser.parse_known_args(cli_args)

setup_logging(args.verbose)

# Down here so runs after logging is setup.
Expand Down

0 comments on commit faef359

Please sign in to comment.