fix(cli): allow --token-name alongside --create-token / --create-read-only-token - #5560
Open
nityanand123gupta wants to merge 1 commit into
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #5491.
--create-tokenand--create-read-only-tokenwere declared withexclusive(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-nameunusable together with either token-creation flag.Fix
Replaced
exclusive(true)on both flags with an explicitconflicts_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-nameto combine with either--create-tokenor--create-read-only-token, matching the existing documentation and the parameter accepted bycreate_auth_token().Testing
cargo build -p zellij-utilssucceeds.zellij web --create-token --token-name fooandzellij web --create-read-only-token --token-name foono longer error with a clap "cannot be used with" conflict, whilezellij web --create-token --stopstill correctly errors as conflicting.