Skip to content

feat: add short aliases for CLI subcommands#150

Merged
joaolfp merged 1 commit into
mainfrom
feat/add-command-aliases
May 7, 2026
Merged

feat: add short aliases for CLI subcommands#150
joaolfp merged 1 commit into
mainfrom
feat/add-command-aliases

Conversation

@joaolfp
Copy link
Copy Markdown
Contributor

@joaolfp joaolfp commented May 7, 2026

✨ Summary

  • add visible alias r for the repos subcommand
  • add visible alias c for the clone subcommand
  • add visible alias a for the all subcommand
  • add visible alias p for the pr subcommand
  • update README to document all short aliases

🔧 Type of Change

  • ✨ Enhancement
  • 🐞 Bug fix
  • 🔐 Security fix
  • 💥 Breaking change
  • 🚀 New feature
  • 📦 New release
  • 📚 Documentation
  • ♻️ Refactor

Note

Low Risk
Low risk: adds Clap visible_aliases for existing subcommands and updates documentation, without changing command execution logic.

Overview
Adds single-letter clap visible_aliases for the repos, clone, all, and pr subcommands so users can run hoc r/c/a/p.

Updates README.md usage examples to document the new short forms alongside the existing commands.

Reviewed by Cursor Bugbot for commit 4175bb1. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

🎉 All unit tests passed!

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces short aliases for CLI commands (r, c, a, p) by updating the clap configuration in src/cli.rs and documenting them in the README.md. The review feedback suggests using the modern 'command' attribute instead of 'clap' for consistency with v4 idioms and recommends restructuring the README examples to improve copy-paste usability by avoiding inline comments.

Comment thread src/cli.rs
#[derive(Subcommand)]
enum Command {
/// List all repositories
#[clap(visible_alias = "r")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the rest of the file (e.g., line 11) and to follow modern clap v4 idioms, it is recommended to use the #[command] attribute instead of #[clap] for subcommand configuration.

Suggested change
#[clap(visible_alias = "r")]
#[command(visible_alias = "r")]

Comment thread src/cli.rs
#[clap(visible_alias = "r")]
Repos,
/// Clone repositories
#[clap(visible_alias = "c")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the rest of the file and to follow modern clap v4 idioms, it is recommended to use the #[command] attribute instead of #[clap].

Suggested change
#[clap(visible_alias = "c")]
#[command(visible_alias = "c")]

Comment thread src/cli.rs
#[clap(visible_alias = "c")]
Clone,
/// Clone all repositories
#[clap(visible_alias = "a")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the rest of the file and to follow modern clap v4 idioms, it is recommended to use the #[command] attribute instead of #[clap].

Suggested change
#[clap(visible_alias = "a")]
#[command(visible_alias = "a")]

Comment thread src/cli.rs
#[clap(visible_alias = "a")]
All,
/// Show open pull requests
#[clap(visible_alias = "p")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with the rest of the file and to follow modern clap v4 idioms, it is recommended to use the #[command] attribute instead of #[clap].

Suggested change
#[clap(visible_alias = "p")]
#[command(visible_alias = "p")]

Comment thread README.md
### List all repositories
```sh
hoc repos
hoc repos # or hoc r
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Including comments like # or hoc r inside the shell code blocks can make them less clean for copy-pasting. Consider documenting the aliases in a more structured way, such as separate lines or in the section headers.

Suggested change
hoc repos # or hoc r
hoc repos
# or
hoc r

Comment thread README.md
### Clone repositories interactively
```sh
hoc clone
hoc clone # or hoc c
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Including comments like # or hoc c inside the shell code blocks can make them less clean for copy-pasting.

Suggested change
hoc clone # or hoc c
hoc clone
# or
hoc c

Comment thread README.md
### Clone all repositories
```sh
hoc all
hoc all # or hoc a
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Including comments like # or hoc a inside the shell code blocks can make them less clean for copy-pasting.

Suggested change
hoc all # or hoc a
hoc all
# or
hoc a

Comment thread README.md
### Show open pull requests
```sh
hoc pr
hoc pr # or hoc p
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Including comments like # or hoc p inside the shell code blocks can make them less clean for copy-pasting.

Suggested change
hoc pr # or hoc p
hoc pr
# or
hoc p

@joaolfp joaolfp merged commit 2f0f3e7 into main May 7, 2026
4 checks passed
@joaolfp joaolfp deleted the feat/add-command-aliases branch May 7, 2026 03:18
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