Skip to content

fix(cli): allow --token-name alongside --create-token / --create-read-only-token - #5560

Open
nityanand123gupta wants to merge 1 commit into
zellij-org:mainfrom
nityanand123gupta:fix/web-cli-token-name-conflict
Open

fix(cli): allow --token-name alongside --create-token / --create-read-only-token#5560
nityanand123gupta wants to merge 1 commit into
zellij-org:mainfrom
nityanand123gupta:fix/web-cli-token-name-conflict

Conversation

@nityanand123gupta

Copy link
Copy Markdown

Description

Fixes #5491.

--create-token and --create-read-only-token were declared with exclusive(true) in clap, which means they reject any other CLI flag being present at the same time — including --token-name, which is documented as the way to name a created token. In practice this makes --token-name unusable together with either token-creation flag.

Fix

Replaced exclusive(true) on both flags with an explicit conflicts_with_all(&[...]) listing only the flags that are genuinely mutually exclusive with token creation (stop, status, daemonize, and the other token-management flags). This preserves the original intent (you can't mix token creation with server lifecycle/other token commands) while allowing --token-name to combine with either --create-token or --create-read-only-token, matching the existing documentation and the parameter accepted by create_auth_token().

Testing

  • cargo build -p zellij-utils succeeds.
  • Manually verified zellij web --create-token --token-name foo and zellij web --create-read-only-token --token-name foo no longer error with a clap "cannot be used with" conflict, while zellij web --create-token --stop still correctly errors as conflicting.

…oken

Previously --create-token and --create-read-only-token were marked
exclusive(true), which rejected ANY other flag including --token-name,
making it impossible to name a created token from the CLI as documented.
Replace with conflicts_with_all() listing only the flags that are
genuinely incompatible (stop/status/daemonize/other token operations),
while allowing --token-name to combine with either token-creation flag.

Fixes zellij-org#5491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--token-name is unusable: --create-token is declared exclusive(true)

1 participant