Skip to content

(cli): "ls" command alias prints an error message to the terminal #1535

@nomike

Description

@nomike

Describe the bug

When running cdk ls, I'm getting the following output on stderr:

$ cdk ls >/dev/null
Unknown option(s): --long, --l, --show-dependencies, --d, --showDependencies. These will be ignored. Run 'cdk --help' to see available options.

The cdk --help clearly documents this as a valid alias:

$ cdk --help
Usage: cdk -a <cdk-app> COMMAND

Commands:
  cdk list [STACKS..]             Lists all stacks in the app      [aliases: ls]
...

After that, cdk seems to go on normally.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

aws-cdk@v2.1122.0

Expected Behavior

There should not be an error about a missing CLI option printed to the terminal.

Current Behavior

An error is printed to the terminal mentioning unknown CLI options which weren't even specified.

Reproduction Steps

  1. Install the affected version of cdk.
  2. Run cdk ls

Possible Solution

No response

Additional Information/Context

This likely surfaced with #1514. Whether it was introduced there or it already existed prior to that and just got exposed now, I don't know.

CDK CLI Version

v2.1123.0

Framework Version

2.256.0

Node.js Version

v22.14.0

OS

Ubuntu 24.04.4 LTS

Language

Python

Language Version

3.12.3

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions