Skip to content

Implement missing Command and Update type safety in main#115

Open
GoatHero wants to merge 12 commits intomainfrom
modern-cli
Open

Implement missing Command and Update type safety in main#115
GoatHero wants to merge 12 commits intomainfrom
modern-cli

Conversation

@GoatHero
Copy link
Collaborator

@GoatHero GoatHero commented Feb 12, 2026

Description

Added command stubs for all command listed in the documentation. Created corresponding function stubs in the cli code files
as well. Note because all tests involving CLI are currently ignored and all the functions created are just stubs that always return ok no new tests were added for these functions. Changed all references to paths in commands that used String to PathBuf adding in the value hinting to the command structure. Pulled my hash implementation from the onboarding project in order to implement all commands

Related Issue

Fixes #103

Type of Change

  • Bug fix
  • New feature
  • Refactoring / CI / Docs
  • Other

How to Test

cargo run -- --help

Will show all new command stubs

cargo run  remove --help

Will show the new variable --force

Checklist

  • Code follows project style (cargo fmt + cargo clippy)
  • Tests added/updated and passing (cargo test)
  • Documentation updated (if applicable)

@GoatHero GoatHero self-assigned this Feb 12, 2026
Copy link
Owner

@Jordan231111 Jordan231111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the implementation work here. I ran a full review with local verification (cargo test, command smoke tests) and this PR is close, but it does not yet meet linked issue #103 acceptance criteria.

Blocking findings:

  1. Missing Hash command in main.rs
  • Issue #103 acceptance requires 10 commands including Hash.
  • src/main.rs defines commands through RemoveFile but does not include a Hash variant (around lines 32-99).
  • Runtime confirmation: cargo run -- --help does not list hash, and cargo run -- hash --help returns error: unrecognized subcommand 'hash'.
  • This also fails the acceptance item: “Existing functionality (Hash command) still works”.
  1. schedule-updates handler output is not aligned with command purpose
  • src/cli/update.rs handle_schedule_command() currently prints "Database updated successfully!" (line ~33), which is misleading for a scheduling-instructions command.
  • The linked issue defines ScheduleUpdates as printing OS-specific scheduling instructions.

Validation run on this branch:

  • cargo test ✅ (passes; warnings only)
  • cargo clippy --all-targets ✅ (passes; warnings only)
  • New command stubs run (schedule-updates, quarantine-file, list-quarantined, restore, remove-file, remove --force) ✅
  • hash command check ❌ (unrecognized subcommand)

Please address the blockers and I’ll re-review promptly.

@Jordan231111
Copy link
Owner

Jordan231111 commented Feb 12, 2026

See my inline review comments on the diff for specific file/line references covering:

  1. Missing --hours option on ScheduleUpdates (plan requires hours: u64, default 24)
  2. Missing --force on RemoveFile (automation parity with Remove)
  3. QuarantineFile field name mismatch — uses --id but plan specifies --name: Option<String>
  4. Unnecessary use anyhow::{Ok, Result} in quarantine.rs and update.rs
  5. Missing run() helper function pattern per plan's Step 06/23 (Phase 0): CLI — Modernize CLI (PathBuf, ExitCode, missing commands) #103 section
  6. ListQuarantined {} / ScheduleUpdates {} — unnecessary empty braces on unit variants
  7. Incomplete force doc comment in remove.rs
  8. Typos: "conformation", "currentlly", "a the", "succsefully"
  9. Out-of-scope updater.rs formatting change — should be reverted or moved to a separate PR

All items above now have inline comments pinned to the exact file and line.

Copy link
Owner

@Jordan231111 Jordan231111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comments below pin each issue to the exact file/line. These cover the items from my follow-up comment, now with precise locations.

Scope check vs Issue #103:

  • PR is generally in scope for #103 (adding command variants, PathBuf migration, ExitCode return) ✅
  • src/database/updater.rs changes are out of scope for #103 — see inline comment
  • Missing Hash command variant remains the primary blocker from my earlier review

The CHANGES_REQUESTED status from my first review still applies.

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.

Step 06/23 (Phase 0): CLI — Modernize CLI (PathBuf, ExitCode, missing commands)

2 participants