Skip to content

Commit

Permalink
giving CLI commands clean exits
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmiguez committed Aug 2, 2022
1 parent 5644a85 commit a274ce2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions manatus/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@
if args.run:
for section in harvest_parser.sections():
cli.harvest(harvest_parser[section], section, write_path, verbosity=verbosity)
sys.exit(0)

# Run harvest selectively by config key
if args.select:
try:
cli.harvest(harvest_parser[args.select], args.select, write_path, verbosity=verbosity)
sys.exit(0)
except KeyError:
print(f'The supplied organization key was not found in the config file.\nSupplied key: {args.select}')
sys.exit(1)
Expand Down Expand Up @@ -199,6 +201,7 @@
try:
cli.transform(manatus_config, scenario_parser[section], section, profile, verbosity=verbosity,
to_console=to_console)
sys.exit(0)
except FileNotFoundError:
logger.warning(f"No data found for {section}")
continue
Expand All @@ -208,6 +211,7 @@
try:
cli.transform(manatus_config, scenario_parser[args.select], args.select, profile, verbosity=verbosity,
to_console=to_console)
sys.exit(0)
except KeyError:
print(f'The supplied organization key was not found in the config file.\nSupplied key: {args.select}')
sys.exit(1)
Expand All @@ -225,3 +229,5 @@
if args.interactive:
cli.interactive_run(manatus_config, scenario_parser, 'transform', profile, verbosity=verbosity,
to_console=to_console)

sys.exit(0)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='manatus',
version='1.0.0',
version='1.0.1',
packages=find_packages(),
url='http://github.com/SunshineStateDigitalNetwork/manatus',
license='MIT',
Expand Down
2 changes: 1 addition & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# The full version, including alpha/beta/rc tags
# release = __version__
release = '1.0.0'
release = '1.0.1'

# -- General configuration ---------------------------------------------------

Expand Down

0 comments on commit a274ce2

Please sign in to comment.