Add command and subcommand shortcuts across all CLI commands
diff --git a/src/bin/ranger/commands/backlog.rs b/src/bin/ranger/commands/backlog.rs
index a86d3f3..86a32b7 100644
--- a/src/bin/ranger/commands/backlog.rs
+++ b/src/bin/ranger/commands/backlog.rs
@@ -18,6 +18,7 @@ pub enum BacklogCommands {
#[command(visible_alias = "ls")]
List,
/// Show a backlog's details
+ #[command(visible_alias = "s")]
Show {
/// Backlog name
#[arg(env = "RANGER_DEFAULT_BACKLOG")]
diff --git a/src/bin/ranger/commands/blocker.rs b/src/bin/ranger/commands/blocker.rs
index cf3f958..1842f3a 100644
--- a/src/bin/ranger/commands/blocker.rs
+++ b/src/bin/ranger/commands/blocker.rs
@@ -8,6 +8,7 @@ use crate::output;
#[derive(Subcommand)]
pub enum BlockerCommands {
/// Add a blocker to a task
+ #[command(visible_alias = "a")]
Add {
/// Task key or prefix (the blocked task)
task: String,
@@ -15,6 +16,7 @@ pub enum BlockerCommands {
blocked_by: String,
},
/// Remove a blocker from a task
+ #[command(visible_alias = "rm")]
Remove {
/// Task key or prefix (the blocked task)
task: String,
diff --git a/src/bin/ranger/commands/comment.rs b/src/bin/ranger/commands/comment.rs
index 15704d6..946e083 100644
--- a/src/bin/ranger/commands/comment.rs
+++ b/src/bin/ranger/commands/comment.rs
@@ -8,6 +8,7 @@ use crate::output;
#[derive(Subcommand)]
pub enum CommentCommands {
/// Add a comment to a task
+ #[command(visible_alias = "a")]
Add {
/// Task key or prefix
task: String,
@@ -15,6 +16,7 @@ pub enum CommentCommands {
body: String,
},
/// List comments on a task
+ #[command(visible_alias = "ls")]
List {
/// Task key or prefix
task: String,
diff --git a/src/bin/ranger/commands/tag.rs b/src/bin/ranger/commands/tag.rs
index b6e5826..07edc1f 100644
--- a/src/bin/ranger/commands/tag.rs
+++ b/src/bin/ranger/commands/tag.rs
@@ -8,6 +8,7 @@ use crate::output;
#[derive(Subcommand)]
pub enum TagCommands {
/// List all tags
+ #[command(visible_alias = "ls")]
List,
}
diff --git a/src/bin/ranger/commands/task.rs b/src/bin/ranger/commands/task.rs
index 00a8943..b1c718d 100644
--- a/src/bin/ranger/commands/task.rs
+++ b/src/bin/ranger/commands/task.rs
@@ -10,10 +10,10 @@ use crate::output;
#[derive(Args)]
pub struct PositionArgs {
/// Place before this task key
- #[arg(long)]
+ #[arg(long, short = 'B')]
before: Option<String>,
/// Place after this task key
- #[arg(long)]
+ #[arg(long, short = 'A')]
after: Option<String>,
}
@@ -36,6 +36,7 @@ impl PositionArgs {
#[derive(Subcommand)]
pub enum TaskCommands {
/// Create a new task
+ #[command(visible_alias = "new")]
Create {
/// Task title
title: String,
@@ -58,6 +59,7 @@ pub enum TaskCommands {
position: PositionArgs,
},
/// List tasks
+ #[command(visible_alias = "ls")]
List {
/// Filter by backlog key or prefix
#[arg(long, env = "RANGER_DEFAULT_BACKLOG")]
@@ -67,11 +69,13 @@ pub enum TaskCommands {
state: Option<String>,
},
/// Show task details
+ #[command(visible_alias = "s")]
Show {
/// Task key or prefix
key: String,
},
/// Edit a task
+ #[command(visible_alias = "e")]
Edit {
/// Task key or prefix
key: String,
@@ -86,6 +90,7 @@ pub enum TaskCommands {
state: Option<String>,
},
/// Move a task's position within a backlog
+ #[command(visible_alias = "mv")]
Move {
/// Task key or prefix
key: String,
@@ -96,6 +101,7 @@ pub enum TaskCommands {
position: PositionArgs,
},
/// Add a task to a backlog
+ #[command(visible_alias = "a")]
Add {
/// Task key or prefix
task: String,
@@ -104,6 +110,7 @@ pub enum TaskCommands {
backlog: String,
},
/// Remove a task from a backlog
+ #[command(visible_alias = "rm")]
Remove {
/// Task key or prefix
task: String,
@@ -112,6 +119,7 @@ pub enum TaskCommands {
backlog: String,
},
/// Delete a task entirely
+ #[command(visible_alias = "del")]
Delete {
/// Task key or prefix
key: String,