Skip to content

Commit

Permalink
rolectl: error out if command line arguments are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
nphilipp authored and sgallagher committed Aug 5, 2015
1 parent cce4f5b commit 76e46b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/rolectl
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ if rk.connected == False:
try:
command = args.parser
except AttributeError:
# Python 3 does not handle this the same way; treat this as identical to --help
parser.print_usage()
sys.exit(0)
# Python 3 does not handle this the same way; treat this similarly to --help
parser.error("missing command")

# version
if command == "version":
Expand All @@ -208,8 +207,7 @@ elif command == "list":
try:
list_type = args.list
except AttributeError:
grp_list.print_usage()
sys.exit(0)
grp_list.error("must specify 'roles' or 'instances'")

if list_type == "roles":
if args.object_path:
Expand Down

0 comments on commit 76e46b5

Please sign in to comment.