Skip to content

Commit

Permalink
closes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kaufman committed May 27, 2015
1 parent 5534f52 commit d61a02a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fencepy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
fencepy activate [options]
fencepy update [options]
fencepy erase [options]
fencepy help
Options:
-h --help Show this screen
-v --verbose Print/log more verbose output
-q --quiet Silence all console output
-s --silent Silence ALL output, including log output (except "activate")
Expand Down Expand Up @@ -121,7 +121,6 @@ def _get_args():
args['plugins'] = dict((key, True) for key in plugins.PLUGINS)
if config.has_section('plugins'):
for key, value in config.items('plugins'):
print(key, value)
if key not in plugins.PLUGINS:
raise KeyError('invalid configuration: {0} is not a valid plugin'.format(key))
args['plugins'][key] = str2bool(value)
Expand Down Expand Up @@ -237,6 +236,13 @@ def fence():
"""Main entry point"""

args = _get_args()

# override default help functionality
if args['help']:
print(DOCOPT)
return 0

# do a main action
for mode in ['activate', 'create', 'update', 'erase']:
if args[mode]:
l.debug('{0}ing environment with args: {1}'.format(mode[:-1], args))
Expand Down

0 comments on commit d61a02a

Please sign in to comment.