diff --git a/cli/src/commands/branch.rs b/cli/src/commands/branch.rs index a06273407..ffbf684a5 100644 --- a/cli/src/commands/branch.rs +++ b/cli/src/commands/branch.rs @@ -150,7 +150,9 @@ pub struct BranchTrackArgs { /// By default, the specified name matches exactly. Use `glob:` prefix to /// select branches by wildcard pattern. For details, see /// https://github.com/martinvonz/jj/blob/main/docs/revsets.md#string-patterns. - #[arg(required = true)] + /// + /// Examples: branch@remote, glob:main@*, glob:jjfan-*@upstream + #[arg(required = true, value_name = "BRANCH@REMOTE")] pub names: Vec, } @@ -165,7 +167,9 @@ pub struct BranchUntrackArgs { /// By default, the specified name matches exactly. Use `glob:` prefix to /// select branches by wildcard pattern. For details, see /// https://github.com/martinvonz/jj/blob/main/docs/revsets.md#string-patterns. - #[arg(required = true)] + /// + /// Examples: branch@remote, glob:main@*, glob:jjfan-*@upstream + #[arg(required = true, value_name = "BRANCH@REMOTE")] pub names: Vec, } diff --git a/cli/tests/test_branch_command.rs b/cli/tests/test_branch_command.rs index 16c78892c..43fd21a7b 100644 --- a/cli/tests/test_branch_command.rs +++ b/cli/tests/test_branch_command.rs @@ -812,7 +812,7 @@ fn test_branch_track_untrack_patterns() { test_env.jj_cmd_ok(&repo_path, &["branch", "create", "main"]); insta::assert_snapshot!( test_env.jj_cmd_cli_error(&repo_path, &["branch", "track", "main"]), @r###" - error: invalid value 'main' for '...': remote branch must be specified in branch@remote form + error: invalid value 'main' for '...': remote branch must be specified in branch@remote form For more information, try '--help'. "###);