Drop the redundant 'api' subcommand #1

Open
opened 2026-05-16 10:01:31 +02:00 by heiko · 1 comment
Owner

Plan 4: Drop the api subcommand

Goal

joker query-domain-list -pattern '*' instead of joker api query-domain-list -pattern '*'

What to change

cmd/joker/main.go

  • Remove the cmd != "api" guard and the flag.Args()[1:] slice-off.
  • Pass flag.Args() directly to run().
  • Update flag.Usage to drop the api <api-command> layer; list commands directly.
  • Keep login as a special case for now (Plan 6 addresses it).

Backwards compat

The api prefix currently serves no purpose. There are no external callers documented.
If you want a grace period, accept api as a transparent alias that prints a deprecation
warning to stderr before stripping it.

Test impact

All run() calls in config_test.go already pass []string{"login"} etc. without
the api prefix — they will work unchanged after this change.

# Plan 4: Drop the `api` subcommand ## Goal `joker query-domain-list -pattern '*'` instead of `joker api query-domain-list -pattern '*'` ## What to change **`cmd/joker/main.go`** - Remove the `cmd != "api"` guard and the `flag.Args()[1:]` slice-off. - Pass `flag.Args()` directly to `run()`. - Update `flag.Usage` to drop the `api <api-command>` layer; list commands directly. - Keep `login` as a special case for now (Plan 6 addresses it). ## Backwards compat The `api` prefix currently serves no purpose. There are no external callers documented. If you want a grace period, accept `api` as a transparent alias that prints a deprecation warning to stderr before stripping it. ## Test impact All `run()` calls in `config_test.go` already pass `[]string{"login"}` etc. without the `api` prefix — they will work unchanged after this change.
Author
Owner

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IUS/joker-dmapi-client#1
No description provided.