Skip to content

Commit

Permalink
Add command authoring error. (Azure#5031)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjprescott authored Dec 4, 2017
1 parent e8668d6 commit 9656401
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/azure-cli-core/azure/cli/core/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,10 @@ def extra(self, dest, **kwargs):
if not self._applicable():
return

if self.scope not in self.command_loader.command_table:
raise ValueError("command authoring error: extra argument '{}' cannot be registered to a group-level "\
"scope '{}'. It must be registered to a specific command.".format(dest, self.scope))

merged_kwargs = self.group_kwargs.copy()
merged_kwargs.update(kwargs)
if self.command_loader.supported_api_version(resource_type=merged_kwargs.get('resource_type'),
Expand Down

0 comments on commit 9656401

Please sign in to comment.