Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore --subscription argument generation in cli code when it has alias. #318

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aaz_dev/cli/controller/az_arg_group_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, args_schema_name, cmd_ctx, arg_group):
def _update_over_arg(self, arg, *arg_keys):
if isinstance(arg, CMDArg):
if isinstance(arg, CMDSubscriptionIdArg) \
and arg_keys == ('subscription', ) and arg.options == ['subscription']:
and arg_keys == ('subscription', ) and 'subscription' in arg.options:
# use self.ctx.subscription_id
self._cmd_ctx.set_argument(('subscription_id', ), arg, ctx_namespace='self.ctx')
else:
Expand Down Expand Up @@ -58,7 +58,7 @@ def iter_scopes(self):
# escape hide argument
continue

if isinstance(a, CMDSubscriptionIdArg) and a.options == ['subscription']:
if isinstance(a, CMDSubscriptionIdArg) and 'subscription' in a.options:
# ignore subscription id, because cli core registered global _subscription argument
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ function ArgumentDialog(props: {
}
}

if (sHelp.length < 1) {
if (sHelp.length < 1 && names.find((n) => { return n === "subscription" || n === "resource-group" }) === undefined) {
setInvalidText(`Field 'Short Summary' is required.`)
return undefined
}
Expand Down