Skip to content

cf <unknown> --help exits 0, and usage errors print the whole help before the error #100

Open

Description

@joeblew999

cf version: 1.0.0-beta.5, macOS

1. --help on an unknown command exits 0. cf nosuchthing --help; echo $? prints the root help and exits 0, so a script checking whether a command exists gets a false yes.

2. Usage errors print the whole help before the error. cf workers list --nosuchflag prints 28 lines. The actual error is in the last 3:

┌ Error
│ Unknown argument: nosuchflag
└

In a terminal or a CI log, | head shows only help text. Agents reading the first lines miss the error.

Expected: an unknown command exits non-zero even with --help. Usage errors print the error first (or only the error, plus a hint to run --help).

Related: #94 (an aborted delete exits 0).

Found while evaluating cf for a dev workflow: https://github.com/joeblew999/cf-cli-test (FINDINGS.md, findings/).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions