fix(cli): Reject unexpected positional arguments in commands#113
Merged
fix(cli): Reject unexpected positional arguments in commands#113
Conversation
When syncing a task that has no verified commit (completed with --no-commit or before the commit requirement was added), we now check the current issue state before setting the new state: - If shouldClose is true: always close - If shouldClose is false AND issue is open: keep open - If shouldClose is false AND issue is closed: DON'T reopen This fixes a bug where syncing on Machine B (with incomplete local task) would reopen an issue that was completed and closed on Machine A. Future work tracked in task x051a582 for bidirectional sync reconciliation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Up to this change, `dex create` was using the first positional argument as the name and was ignoring the rest. That might be surprising if people forget to pass `--description` and just add description as the second positional argument, like: ``` $ dex create "Task name" "Ignored task description" ``` With this change `dex create` will fail on this case with a hint of suggestion usage of `--description` to pass the description properly.
Extend the fix from `dex create` to other commands that were silently discarding extra positional arguments. Commands now error with helpful messages when given unexpected args. Affected commands: edit, complete, delete, start, archive Also adds specs/cli.md documenting core CLI design principles. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
When `--completed` or `--older-than` flags were combined with a positional argument (e.g., `dex archive --completed task123`), the command would silently discard the task ID and archive all completed tasks instead. Now the command explicitly rejects this combination with a helpful error message explaining the mutually exclusive usage patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Extends the fix from
dex createto all other CLI commands that acceptpositional arguments. Previously, commands like
edit,complete,delete,start, andarchivewould silently discard extra positional arguments,which could mask user errors.
Now all commands validate they receive at most the expected number of
positional arguments and provide helpful error messages when given too many.
Also adds
specs/cli.mddocumenting core CLI design principles includingthis behavior.
Supersedes #104