Skip to content
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
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/convert-to-user-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export function convertYargsToUserInput(args: any): UserInput {
break;
}
const userInput: UserInput = {
_: args._[0],
command: args._[0],
globalOptions,
[args._[0]]: commandOptions,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/user-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface UserInput {
/**
* The CLI command name
*/
readonly _?: Command;
readonly command?: Command;

/**
* Global options available to all CLI commands
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk/test/cli-arguments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('yargs', () => {
const result = convertYargsToUserInput(input);

expect(result).toEqual({
_: 'deploy',
command: 'deploy',
globalOptions: {
app: undefined,
assetMetadata: undefined,
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('yargs', () => {
const result = convertYargsToUserInput(input);

expect(result).toEqual({
_: 'deploy',
command: 'deploy',
deploy: expect.objectContaining({
STACKS: ['stack1', 'stack2'],
}),
Expand All @@ -87,7 +87,7 @@ describe('yargs', () => {
const result = convertYargsToUserInput(input);

expect(result).toEqual({
_: 'acknowledge',
command: 'acknowledge',
acknowledge: expect.objectContaining({
ID: 'id1',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function buildPositionalArguments(arg: { name: string; variadic: boolean }, argN
function buildUserInput(argName: string): string {
return [
'const userInput: UserInput = {',
`_: ${argName}._[0],`,
`command: ${argName}._[0],`,
'globalOptions,',
`[${argName}._[0]]: commandOptions`,
'}',
Expand Down
2 changes: 1 addition & 1 deletion tools/@aws-cdk/user-input-gen/lib/user-input-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function renderUserInputType(config: CliConfig): Promise<string> {
const commandEnum = Type.fromName(scope, 'Command');

userInputType.addProperty({
name: '_',
name: 'command',
type: commandEnum,
docs: {
summary: 'The CLI command name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('render', () => {
break;
}
const userInput: UserInput = {
_: args._[0],
command: args._[0],
globalOptions,
[args._[0]]: commandOptions,
};
Expand Down
6 changes: 3 additions & 3 deletions tools/@aws-cdk/user-input-gen/test/user-input-gen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('render', () => {
/**
* The CLI command name
*/
readonly _?: Command;
readonly command?: Command;

/**
* Global options available to all CLI commands
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('render', () => {
/**
* The CLI command name
*/
readonly _?: Command;
readonly command?: Command;

/**
* Global options available to all CLI commands
Expand Down Expand Up @@ -251,7 +251,7 @@ describe('render', () => {
/**
* The CLI command name
*/
readonly _?: Command;
readonly command?: Command;

/**
* Global options available to all CLI commands
Expand Down
Loading