Skip to content

tg api takes a space-separated flag value as true #68

Closed

Description

@neoromantic

tg api <method> --name value passes true for name: citty reads unknown flags without = as booleans and leaves value as a positional. So tg api account.checkUsername --username myuser fails with TELEGRAM_ERROR (exit 5), while --username=myuser and --json '{"username":"myuser"}' work.

Fix: either read --name value pairs for unknown flags in tg api, or fail with INVALID_ARGS that suggests --name=value when a method argument comes out as true and a stray positional follows it.

Done when an e2e test shows tg api account.checkUsername --username myuser and --username=myuser build the same call (or the first fails with INVALID_ARGS and the suggestion), and docs/api-design.md says which form works.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions