Use general exception for usage error

This commit is contained in:
Ivan Kravets
2015-12-07 17:43:59 +02:00
parent 28619a6ce7
commit b7ab825860
2 changed files with 1 additions and 7 deletions

View File

@@ -46,7 +46,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
try: try:
return self._handle_obsolate_command(name) return self._handle_obsolate_command(name)
except AttributeError: except AttributeError:
raise exception.UnknownCLICommand(name) raise click.UsageError('No such command "%s"' % name, ctx)
return mod.cli return mod.cli
@staticmethod @staticmethod

View File

@@ -48,12 +48,6 @@ class PlatformNotInstalledYet(PlatformioException):
"Use `platformio platforms install` command" "Use `platformio platforms install` command"
class UnknownCLICommand(PlatformioException):
MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\
" to see all available commands"
class UnknownBoard(PlatformioException): class UnknownBoard(PlatformioException):
MESSAGE = "Unknown board type '%s'" MESSAGE = "Unknown board type '%s'"