Skip to content

Fix incorrect short flag for --success in ledger-stats log#1006

Closed
beck042 wants to merge 1 commit intomagicblock-labs:masterfrom
beck042:beck042-patch-1
Closed

Fix incorrect short flag for --success in ledger-stats log#1006
beck042 wants to merge 1 commit intomagicblock-labs:masterfrom
beck042:beck042-patch-1

Conversation

@beck042
Copy link

@beck042 beck042 commented Mar 1, 2026

Summary

In the documentation for the log subcommand in ledger-stats, the short flag for --success was specified as -s, which was misleading.

Reason for the fix:

In the code (src/main.rs), the short flag -u (short = “u”) is used for --success.

At the same time, -s is reserved for --start, so using -s for --success created a conflict and was misinterpreted by StructOpt.

Fix:

The short flag for --success has been changed to -u in the README.

The usage examples have been updated to match the code and avoid confusion.

Compatibility

  • No breaking changes
  • Config change (describe):
  • Migration needed (describe):

Testing

  • tests (or explain)

Checklist

  • docs updated (if needed)
  • closes #

Summary by CodeRabbit

  • Documentation
    • Updated command-line flag documentation for the ledger-stats tool to reflect the correct syntax for displaying successful transactions.

Description:
In the documentation for the log `subcommand` in `ledger-stats`, the short flag for `--success` was specified as `-s`, which was misleading.

Reason for the fix:

In the code (`src/main.rs`), the short flag `-u` (short = `“u”`) is used for `--success`.

At the same time, `-s` is reserved for `--start`, so using `-s` for `--success` created a conflict and was misinterpreted by `StructOpt`.

Fix:

The short flag for `--success` has been changed to `-u` in the README.

The usage examples have been updated to match the code and avoid confusion.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

📝 Walkthrough

Walkthrough

The pull request updates the documentation for the ledger-stats tool by modifying a command-line flag definition. Specifically, the short form flag for displaying successful transactions is changed from -s to -u, while the long form --success remains unchanged. This is a documentation update affecting how the option is referenced in the tool's usage instructions.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/ledger-stats/README.md (1)

8-8: 🧹 Nitpick | 🔵 Trivial

Optional: Consider demonstrating the short form flag in examples.

While the current examples using --success are correct, adding at least one example with the short form -u would help users discover this option and confirm it works as documented.

📝 Optional: Add example with short form

For instance, you could update line 8 to demonstrate the short form:

-cargo run --bin ledger-stats -- log ./tools/ledger-stats/ledger/ --success
+cargo run --bin ledger-stats -- log ./tools/ledger-stats/ledger/ -u

Or add a comment showing both forms are equivalent:

 cargo run --bin ledger-stats -- log ./tools/ledger-stats/ledger/ --success
+# Or using the short form: cargo run --bin ledger-stats -- log ./tools/ledger-stats/ledger/ -u

Also applies to: 68-68

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/ledger-stats/README.md` at line 8, Update the README examples to
demonstrate the short-form flag for the same option shown with --success: add at
least one example command showing -u (the short form of --success) alongside or
in place of the existing cargo run example so users can see both forms work
(reference the existing example using --success and the equivalent -u short
flag).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@tools/ledger-stats/README.md`:
- Line 8: Update the README examples to demonstrate the short-form flag for the
same option shown with --success: add at least one example command showing -u
(the short form of --success) alongside or in place of the existing cargo run
example so users can see both forms work (reference the existing example using
--success and the equivalent -u short flag).

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef9dd9b and 42ec746.

📒 Files selected for processing (1)
  • tools/ledger-stats/README.md

@bmuddha bmuddha closed this Mar 2, 2026
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.

2 participants