You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(toolkit): options requiring arguments fail if not supplied (#2197)
Some options require arguments, but without passing `requiresArg: true`
to `yargs` it will happily accept the flag and put `undefined` or an
empty string in the value (instead of rejecting the invocation).
Add `requiresArg` to a number of options that have this property.
Fixes#2192.
.option('plugin',{type: 'array',alias: 'p',desc: 'Name or path of a node package that extend the CDK features. Can be specified multiple times',nargs: 1})
39
39
.option('rename',{type: 'string',desc: 'Rename stack name if different from the one defined in the cloud executable',requiresArg: '[ORIGINAL:]RENAMED'})
@@ -42,20 +42,20 @@ async function parseCommandLineArguments() {
42
42
.option('ignore-errors',{type: 'boolean',default: false,desc: 'Ignores synthesis errors, which will likely produce an invalid output'})
43
43
.option('json',{type: 'boolean',alias: 'j',desc: 'Use JSON output instead of YAML'})
.option('version-reporting',{type: 'boolean',desc: 'Include the "AWS::CDK::Metadata" resource in synthesized templates (enabled by default)',default: undefined})
49
49
.option('path-metadata',{type: 'boolean',desc: 'Include "aws:cdk:path" CloudFormation metadata for each resource (enabled by default)',default: true})
50
50
.option('asset-metadata',{type: 'boolean',desc: 'Include "aws:asset:*" CloudFormation metadata for resources that user assets (enabled by default)',default: true})
51
-
.option('role-arn',{type: 'string',alias: 'r',desc: 'ARN of Role to use when invoking CloudFormation',default: undefined})
52
-
.option('toolkit-stack-name',{type: 'string',desc: 'The name of the CDK toolkit stack'})
51
+
.option('role-arn',{type: 'string',alias: 'r',desc: 'ARN of Role to use when invoking CloudFormation',default: undefined,requiresArg: true})
52
+
.option('toolkit-stack-name',{type: 'string',desc: 'The name of the CDK toolkit stack',requiresArg: true})
53
53
.command(['list','ls'],'Lists all stacks in the app',yargs=>yargs
54
54
.option('long',{type: 'boolean',default: false,alias: 'l',desc: 'display environment information for each stack'}))
55
55
.command(['synthesize [STACKS..]','synth [STACKS..]'],'Synthesizes and prints the CloudFormation template for this stack',yargs=>yargs
56
56
.option('exclusively',{type: 'boolean',alias: 'e',desc: 'only deploy requested stacks, don\'t include dependencies'})
57
57
.option('interactive',{type: 'boolean',alias: 'i',desc: 'interactively watch and show template updates'})
58
-
.option('output',{type: 'string',alias: 'o',desc: 'write CloudFormation template for requested stacks to the given directory'})
58
+
.option('output',{type: 'string',alias: 'o',desc: 'write CloudFormation template for requested stacks to the given directory',requiresArg: true})
59
59
.option('numbered',{type: 'boolean',alias: 'n',desc: 'prefix filenames with numbers to indicate deployment ordering'}))
60
60
.command('bootstrap [ENVIRONMENTS..]','Deploys the CDK toolkit stack into an AWS environment')
61
61
.command('deploy [STACKS..]','Deploys the stack(s) named STACKS into your AWS account',yargs=>yargs
@@ -68,8 +68,8 @@ async function parseCommandLineArguments() {
68
68
.option('force',{type: 'boolean',alias: 'f',desc: 'Do not ask for confirmation before destroying the stacks'}))
69
69
.command('diff [STACKS..]','Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found',yargs=>yargs
70
70
.option('exclusively',{type: 'boolean',alias: 'e',desc: 'only diff requested stacks, don\'t include dependencies'})
71
-
.option('context-lines',{type: 'number',desc: 'number of context lines to include in arbitrary JSON diff rendering',default: 3})
72
-
.option('template',{type: 'string',desc: 'the path to the CloudFormation template to compare with'})
71
+
.option('context-lines',{type: 'number',desc: 'number of context lines to include in arbitrary JSON diff rendering',default: 3,requiresArg: true})
72
+
.option('template',{type: 'string',desc: 'the path to the CloudFormation template to compare with',requiresArg: true})
73
73
.option('strict',{type: 'boolean',desc: 'do not filter out AWS::CDK::Metadata resources',default: false}))
74
74
.command('metadata [STACK]','Returns all metadata associated with this stack')
75
75
.command('init [TEMPLATE]','Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used.',yargs=>yargs
0 commit comments