Skip to content

feat: add -O/-F short flags and hidden --force alias - #52

Merged
nerdCopter merged 1 commit into
masterfrom
feat/cli-short-aliases
Sep 2, 2026
Merged

nerdCopter merged 1 commit into
masterfrom
feat/cli-short-aliases

Conversation

@nerdCopter

@nerdCopter nerdCopter commented Sep 2, 2026

Copy link
Copy Markdown
Owner

AI Generated pull-request

Summary

  • -O short flag for --output-dir
  • -F short flag for --force-export
  • --force hidden long alias for --force-export (works, not listed in --help)

Test plan

  • cargo test --verbose passes (53+11+8+3 tests)
  • cargo test --features=cli --verbose passes
  • cargo build --release passes with no errors/warnings
  • cargo fmt --all -- --check passes
  • cargo clippy --all-targets --all-features -- -D warnings — pre-existing failure unrelated to this change (src/parser/frame.rs:719, needless_range_loop); reproduces identically on unmodified master

Summary by CodeRabbit

  • New Features
    • Added -O as a shortcut for specifying the output directory.
    • Added -F as a shortcut for enabling forced exports.
    • Added force as an alias for the force-export option.

-O aliases --output-dir, -F aliases --force-export. --force is a hidden alias for --force-export, kept out of --help since --force-export names the exact behavior (bypass smart export filtering).
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: e94bf6cb-6c0c-44be-b39c-92de38ce6eee

📥 Commits

Reviewing files that changed from the base of the PR and between 283c05e and 898ed6d.

📒 Files selected for processing (1)
  • src/main.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Check and Lint
🧰 Additional context used
📓 Path-based instructions (3)
Maintain CLI source as `src/main.rs` and library core as `src/lib.rs`

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • src/main.rs
CLI (`src/main.rs`) uses library export functions (`export_to_csv`, `export_to_gpx`, `export_to_event`) with CLI-specific status messages as thin wrapper with zero public functions

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • src/main.rs
Do not remove or modify comments unless the related code is changed; only add comments that explain code functionality, no AI instructional comments Never embed or call external binaries from Rust code Ensure `cargo build --release` has no...

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • src/main.rs
🔇 Additional comments (1)
src/main.rs (1)

295-295: LGTM!

Also applies to: 320-322


📝 Walkthrough

Walkthrough

The CLI adds -O for output-dir, -F for force-export, and force as an alias for force-export.

Changes

CLI option aliases

Layer / File(s) Summary
Export option names
src/main.rs
The CLI accepts -O for output-dir, -F for force-export, and force as an alias for force-export.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 898ed

This is a localized CLI compatibility change adding short flags and a hidden alias, with no actionable merge-blocking risk remaining after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: adding -O and -F short flags and a hidden --force alias.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cli-short-aliases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nerdCopter

Copy link
Copy Markdown
Owner Author

@coderabbitai — AI generated comment

Analysis requested on this small CLI change:

  1. Are .short('O') on output-dir and .short('F')/.alias("force") on force-export consistent with clap v4 idioms used elsewhere in this file (e.g. -V/--version)?
  2. Any short-flag collision risk with existing or reasonably foreseeable future flags?
  3. Is a hidden .alias("force") (invokable, not shown in --help) the right call here, versus a .visible_alias() or no alias at all?

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== src/main.rs outline =='
ast-grep outline src/main.rs --items all --type function --view expanded || true

echo '== clap dependency declarations =='
rg -n -C 2 '(^clap\s*=|name = "clap"|clap\s*=)' Cargo.toml Cargo.lock 2>/dev/null || true

echo '== argument and short/alias declarations in src/main.rs =='
rg -n -C 3 '\.(short|long|alias|visible_alias|version|help)\s*\(' src/main.rs

Length of output: 4431


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== build_command =='
sed -n '266,355p' src/main.rs

echo '== CLI references in source, tests, and docs =='
rg -n -i -C 2 --glob '!Cargo.lock' \
  '(^|[^[:alnum:]_-])(output-dir|force-export|--force|-O\b|-F\b)([^[:alnum:]_-]|$)|get_one\s*::<.*>\s*\(\s*"(output-dir|force-export|force)"' \
  .

Length of output: 5451


@nerdCopter

  1. clap v4 idioms: Yes. The declarations use the same builder-style API as -V / --version in src/main.rs Line 274. .short('O'), .short('F'), and .alias("force") are valid clap v4 Arg configuration calls. The application reads the canonical IDs, "output-dir" and "force-export", at Lines 350-351. The alias does not require a separate get_flag("force") check.

  2. Short-flag collisions: No current collision exists. build_command assigns -V, -O, and -F only. The uppercase choices also leave the common lowercase option space free for future options such as -o or -f. -O maps clearly to output. -F maps clearly to force. This allocation has low future collision risk.

  3. Hidden alias: .alias("force") is the right choice if --force is an accepted compatibility or convenience spelling but --force-export is the preferred documented interface. It keeps --help focused on the more precise behavior.

    Use .visible_alias("force") only if both spellings are equally supported and should be discoverable. Remove the alias only if avoiding the broad and potentially ambiguous --force spelling is more important than compatibility. The stated intent supports the hidden .alias("force") choice.

No change is required.

You are interacting with an AI system.

@nerdCopter

Copy link
Copy Markdown
Owner Author

AI Generated comment

Multi-tool review summary for this change (-O/-F short flags, hidden --force alias):

  • CodeRabbit local CLI (coderabbit review --agent --base origin/master): 0 findings.
  • CodeRabbit GitHub bot analysis: no changes required. Confirms .short()/.alias() usage matches clap v4 idioms already in this file (-V/--version), no short-flag collisions, and validates hidden .alias("force") as the right choice given --force-export is the documented/preferred spelling.
  • Second-opinion pass (fallback chain): pi hit its daily free-tier rate limit, opencode timed out, AGY completed — confirms no short-flag collisions (-V, -h, -O, -F all unique) and correct clap v4 builder API usage, all three invocation forms (--force-export, --force, -F) resolve to the same get_flag("force-export") check.

No actionable findings from any tool.

@nerdCopter
nerdCopter merged commit ee06676 into master Sep 2, 2026
9 checks passed
@nerdCopter
nerdCopter deleted the feat/cli-short-aliases branch September 2, 2026 15:07
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