Skip to content

Commit

Permalink
cli branch create/set: add --to aliases for -r
Browse files Browse the repository at this point in the history
Now that `jj move` does not accept `-r` (since it has `--from` and `--to`), `jj set --to` seems more useful
than `jj set -r`. `create --to` is also added for ease of switching
between `branch create` and `branch move`.
  • Loading branch information
ilyagr committed Jul 18, 2024
1 parent 3043b83 commit 3d06620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cli/src/commands/branch/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ use crate::ui::Ui;
#[derive(clap::Args, Clone, Debug)]
pub struct BranchCreateArgs {
/// The branch's target revision
#[arg(long, short)]
//
// The `--to` alias exists for making it easier for the user to switch
// between `branch create`, `branch move`, and `branch set`.
#[arg(long, short, visible_alias = "to")]
revision: Option<RevisionArg>,

/// The branches to create
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/branch/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::ui::Ui;
#[derive(clap::Args, Clone, Debug)]
pub struct BranchSetArgs {
/// The branch's target revision
#[arg(long, short)]
#[arg(long, short, visible_alias = "to")]
revision: Option<RevisionArg>,

/// Allow moving the branch backwards or sideways
Expand Down

0 comments on commit 3d06620

Please sign in to comment.