Skip to content

fix(cli): refuse pin --days 0 and --days without a folder - #9

Merged
Finjineersdev merged 1 commit into
mainfrom
fix-pin-days-flags
Nov 27, 2026
Merged

Finjineersdev merged 1 commit into
mainfrom
fix-pin-days-flags

Conversation

@Finjineersdev

Copy link
Copy Markdown
Owner

What

Two ways pin accepted --days and did not do what it said:

  • opensweep pin FOLDER --days 0 printed "Pinned ... for 0 days." and wrote a pin whose end time was already now. The project was judged as usual straight away, but the user had just been told it was pinned. pin then still listed it with "(until )".
  • opensweep pin --days 7 with no folder only listed the pins and dropped --days without a word.

Both are now clap usage errors (exit code 2) and the config file is not written. --days takes 1 or more and needs a folder. --days with --remote was already refused.

The app only calls pin --days 30 or pin with no days (ProjectsView.swift), so it is not affected.

Also gives the FOLDER argument of pin and unpin a help line; opensweep pin --help showed it blank.

How tested

  • New end-to-end test a_pin_for_days_needs_a_folder_and_at_least_one_day: --days 0 and --days without a folder fail and write no config; --days 1 still works. It fails on main and passes with the fix.
  • cargo fmt --all --check: ok
  • cargo clippy --all-targets --locked -- -D warnings: ok
  • cargo test --locked: 146 passed, 0 failed
  • cargo run -q -p opensweep-cli -- rules-check rules: 11 rule files, 31 artifacts: ok
  • cd CleanCore && swift test: 21 tests, 0 failures; scripts/check-swift-never-deletes.sh: ok
  • QA-CHECKLIST row 7 (pin a project) uses "Pin for good" / "Pin for 30 days", which are unchanged; not re-run in the app.

🤖 Generated with Claude Code

`opensweep pin FOLDER --days 0` printed "Pinned ... for 0 days" and wrote
a pin that had already ended, so the project was judged as usual.
`opensweep pin --days 7` with no folder listed the pins and dropped
--days without a word. Both are now usage errors and nothing is written.
The app only pins for 30 days or for good, so it is not affected.

Also gives the FOLDER argument of pin and unpin a help line; `--help`
showed it blank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Finjineersdev
Finjineersdev merged commit 2603d10 into main Nov 27, 2026
6 checks passed
@Finjineersdev
Finjineersdev deleted the fix-pin-days-flags branch November 27, 2026 22:47
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.

1 participant