Skip to content

Show error instead of help when the user uses an unsupported subcommand on the CLI #10760

Closed
@mafredri

Description

@mafredri

The coder CLI quietly accepts any subcommand arguments and silently swallows them. This is confusing for users since they should really be seeing an error that the subcommand doesn't exist.

❯ coder | head -n5
coder v2.3.3+e491217

USAGE:
  coder [global-flags] <subcommand>

❯ coder idontexist | head -n5
coder v2.3.3+e491217

USAGE:
  coder [global-flags] <subcommand>

❯ coder idontexist --help | head -n5
coder v2.3.3+e491217

USAGE:
  coder [global-flags] <subcommand>

Expected:

❯ coder idontexist
error: command "coder idontexist" doesn't exist, see "coder --help" for more information

❯ coder iexistbut idontexist
error: command "coder iexistbut idontexist" doesn't exist, see "coder iexistbut --help" for more information

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliArea: CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions