Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Provide nicer messaging for user when using the clear subcommands. Cl…
Browse files Browse the repository at this point in the history
…oses #330.
  • Loading branch information
chambridge committed Sep 27, 2017
1 parent 68d8fd3 commit d3d1b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rho/authclearcommand.py
Expand Up @@ -49,10 +49,14 @@ def _validate_options(self):
CliCommand._validate_options(self)

if not self.options.name and not self.options.all:
print(_('You must provide either "--all" or a value for '
'"--name".'))
self.parser.print_help()
sys.exit(1)

if self.options.name and self.options.all:
print(_('You must provide either "--all" or a value for '
'"--name". You cannot supply both.'))
self.parser.print_help()
sys.exit(1)

Expand Down
4 changes: 4 additions & 0 deletions rho/profileclearcommand.py
Expand Up @@ -75,10 +75,14 @@ def _validate_options(self):
CliCommand._validate_options(self)

if not self.options.name and not self.options.all:
print(_('You must provide either "--all" or a value for '
'"--name".'))
self.parser.print_help()
sys.exit(1)

if self.options.name and self.options.all:
print(_('You must provide either "--all" or a value for '
'"--name". You cannot supply both.'))
self.parser.print_help()
sys.exit(1)

Expand Down

0 comments on commit d3d1b7b

Please sign in to comment.