Skip to content

subcommand option errors fall back to top-level usage #75

Description

@HoyeonRhee

When an unknown option is passed after a subcommand, b4 reports the error
from the top-level parser and prints the global usage.
(version: b4 0.16-dev-bc4c7)

$ b4 dig --unknown-arg

# Actual:
usage: b4 [-h] [--version] [-d] [-q] [-n] [--offline-mode] [--no-stdin]
          [-c NAME=VALUE]
          {mbox,am,shazam,review,pr,ty,diff,kr,prep,trailers,send,dig} ...
b4: error: unrecognized arguments: --unknown-arg

# Expected:
usage: b4 dig [-h] [-c COMMITISH] [-C] [-a | -m DEST | -w]
b4 dig: error: unrecognized arguments: --unknown-arg

I would expect the selected subcommand to report its own option instead.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions