Skip to content

auth status falls through to help and exits 0 instead of erroring #23

Description

@DTTerastar

Severity

minor

Summary

On the shipped binary auth status is not registered, so Cobra treats status as a positional arg, prints the auth help, and exits 0. Scripts that test withings-export auth status; echo $? to see whether the CLI is logged in see a green light unconditionally.

Reproduce

$ withings-export auth status; echo "EXIT=$?"
Authentication commands

Usage:
  withings-export auth [command]

Available Commands:
  login       ...
  logout      ...
  refresh     ...
EXIT=0

Expected

With auth status registered (it is on main, see PR #9 / #14), this prints a one-line readiness status and exits 0/1 appropriately. While that's missing, an unknown subcommand should at least print Error: unknown command "status" for "withings-export auth" and exit non-zero — Cobra's default — but currently does not. Worth checking whether authCmd has SilenceUsage/Args set somewhere causing the swallow.

Metadata

Metadata

Assignees

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