diff --git a/cli/src/commands/abandon.rs b/cli/src/commands/abandon.rs index 77f2ed8786..9b02cedc69 100644 --- a/cli/src/commands/abandon.rs +++ b/cli/src/commands/abandon.rs @@ -37,7 +37,11 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct AbandonArgs { /// The revision(s) to abandon - #[arg(default_value = "@", add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + default_value = "@", + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revisions: Vec, /// Do not print every abandoned commit on a separate line #[arg(long, short)] diff --git a/cli/src/commands/absorb.rs b/cli/src/commands/absorb.rs index 05046f41fe..ac19d4c382 100644 --- a/cli/src/commands/absorb.rs +++ b/cli/src/commands/absorb.rs @@ -39,6 +39,7 @@ pub(crate) struct AbsorbArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions), )] from: RevisionArg, @@ -48,6 +49,7 @@ pub(crate) struct AbsorbArgs { #[arg( long, short = 't', visible_alias = "to", default_value = "mutable()", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::mutable_revisions), )] into: Vec, diff --git a/cli/src/commands/backout.rs b/cli/src/commands/backout.rs index 5bdee8c3c9..eefea79be0 100644 --- a/cli/src/commands/backout.rs +++ b/cli/src/commands/backout.rs @@ -31,6 +31,7 @@ pub(crate) struct BackoutArgs { #[arg( long, short, default_value = "@", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] revisions: Vec, @@ -40,6 +41,7 @@ pub(crate) struct BackoutArgs { #[arg( long, short, default_value = "@", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] destination: Vec, diff --git a/cli/src/commands/bookmark/create.rs b/cli/src/commands/bookmark/create.rs index bcf41c6cdd..cd52bb889b 100644 --- a/cli/src/commands/bookmark/create.rs +++ b/cli/src/commands/bookmark/create.rs @@ -35,6 +35,7 @@ pub struct BookmarkCreateArgs { #[arg( long, short, visible_alias = "to", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] revision: Option, diff --git a/cli/src/commands/bookmark/list.rs b/cli/src/commands/bookmark/list.rs index d95e20ebc1..e9c176df3b 100644 --- a/cli/src/commands/bookmark/list.rs +++ b/cli/src/commands/bookmark/list.rs @@ -84,7 +84,7 @@ pub struct BookmarkListArgs { /// /// Note that `-r deleted_bookmark` will not work since `deleted_bookmark` /// wouldn't have a local target. - #[arg(long, short)] + #[arg(long, short, value_name = "REVSETS")] revisions: Option>, /// Render each bookmark using the given template diff --git a/cli/src/commands/bookmark/move.rs b/cli/src/commands/bookmark/move.rs index 26208352c5..c6a229f51d 100644 --- a/cli/src/commands/bookmark/move.rs +++ b/cli/src/commands/bookmark/move.rs @@ -49,7 +49,7 @@ pub struct BookmarkMoveArgs { #[arg( long, group = "source", - value_name = "REVISIONS", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] from: Vec, @@ -60,7 +60,7 @@ pub struct BookmarkMoveArgs { #[arg( long, default_value = "@", - value_name = "REVISION", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] to: RevisionArg, diff --git a/cli/src/commands/bookmark/set.rs b/cli/src/commands/bookmark/set.rs index 0922f9df47..cb1af9cbdf 100644 --- a/cli/src/commands/bookmark/set.rs +++ b/cli/src/commands/bookmark/set.rs @@ -33,6 +33,7 @@ pub struct BookmarkSetArgs { #[arg( long, short, visible_alias = "to", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] revision: Option, diff --git a/cli/src/commands/debug/copy_detection.rs b/cli/src/commands/debug/copy_detection.rs index 5aecc7dc92..7ca75ebb80 100644 --- a/cli/src/commands/debug/copy_detection.rs +++ b/cli/src/commands/debug/copy_detection.rs @@ -28,7 +28,7 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub struct CopyDetectionArgs { /// Show changes in this revision, compared to its parent(s) - #[arg(default_value = "@")] + #[arg(default_value = "@", value_name = "REVSET")] revision: RevisionArg, } diff --git a/cli/src/commands/debug/tree.rs b/cli/src/commands/debug/tree.rs index 3255082029..70010dec2f 100644 --- a/cli/src/commands/debug/tree.rs +++ b/cli/src/commands/debug/tree.rs @@ -29,7 +29,7 @@ use crate::ui::Ui; /// List the recursive entries of a tree. #[derive(clap::Args, Clone, Debug)] pub struct DebugTreeArgs { - #[arg(long, short = 'r')] + #[arg(long, short = 'r', value_name = "REVSET")] revision: Option, #[arg(long, conflicts_with = "revision")] id: Option, diff --git a/cli/src/commands/describe.rs b/cli/src/commands/describe.rs index cd2c0ce4a7..1508e931f0 100644 --- a/cli/src/commands/describe.rs +++ b/cli/src/commands/describe.rs @@ -44,7 +44,11 @@ use crate::ui::Ui; #[command(visible_aliases = &["desc"])] pub(crate) struct DescribeArgs { /// The revision(s) whose description to edit - #[arg(default_value = "@", add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + default_value = "@", + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revisions: Vec, /// Ignored (but lets you pass `-r` for consistency with other commands) #[arg(short = 'r', hide = true, action = clap::ArgAction::Count)] diff --git a/cli/src/commands/diff.rs b/cli/src/commands/diff.rs index 1ccc9659ec..1e811e5ad7 100644 --- a/cli/src/commands/diff.rs +++ b/cli/src/commands/diff.rs @@ -49,13 +49,30 @@ pub(crate) struct DiffArgs { /// If the revision is a merge commit, this shows changes *from* the /// automatic merge of the contents of all of its parents *to* the contents /// of the revision itself. - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] revision: Option, /// Show changes from this revision - #[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + conflicts_with = "revision", + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] from: Option, /// Show changes to this revision - #[arg(long, short, conflicts_with = "revision", add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + conflicts_with = "revision", + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] to: Option, /// Restrict the diff to these paths #[arg( diff --git a/cli/src/commands/diffedit.rs b/cli/src/commands/diffedit.rs index 8763ce815b..2009543655 100644 --- a/cli/src/commands/diffedit.rs +++ b/cli/src/commands/diffedit.rs @@ -50,7 +50,12 @@ pub(crate) struct DiffeditArgs { /// The revision to touch up /// /// Defaults to @ if neither --to nor --from are specified. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revision: Option, /// Show changes from this revision /// @@ -58,6 +63,7 @@ pub(crate) struct DiffeditArgs { #[arg( long, short, conflicts_with = "revision", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] from: Option, @@ -67,6 +73,7 @@ pub(crate) struct DiffeditArgs { #[arg( long, short, conflicts_with = "revision", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions), )] to: Option, diff --git a/cli/src/commands/duplicate.rs b/cli/src/commands/duplicate.rs index 075d1b51f1..a28fec6101 100644 --- a/cli/src/commands/duplicate.rs +++ b/cli/src/commands/duplicate.rs @@ -52,13 +52,21 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct DuplicateArgs { /// The revision(s) to duplicate (default: @) - #[arg(value_name = "REVISIONS", add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::all_revisions) + )] revisions_pos: Vec, - #[arg(short = 'r', hide = true)] + #[arg(short = 'r', hide = true, value_name = "REVSETS")] revisions_opt: Vec, /// The revision(s) to duplicate onto (can be repeated to create a merge /// commit) - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::all_revisions) + )] destination: Vec, /// The revision(s) to insert after (can be repeated to create a merge /// commit) @@ -67,6 +75,7 @@ pub(crate) struct DuplicateArgs { short = 'A', visible_alias = "after", conflicts_with = "destination", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] insert_after: Vec, @@ -77,6 +86,7 @@ pub(crate) struct DuplicateArgs { short = 'B', visible_alias = "before", conflicts_with = "destination", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::mutable_revisions) )] insert_before: Vec, diff --git a/cli/src/commands/edit.rs b/cli/src/commands/edit.rs index b89754e58a..a16fa655a0 100644 --- a/cli/src/commands/edit.rs +++ b/cli/src/commands/edit.rs @@ -33,7 +33,7 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct EditArgs { /// The commit to edit - #[arg(add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg(value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions))] revision: RevisionArg, /// Ignored (but lets you pass `-r` for consistency with other commands) #[arg(short = 'r', hide = true)] diff --git a/cli/src/commands/evolog.rs b/cli/src/commands/evolog.rs index d354e46f66..985a566ab2 100644 --- a/cli/src/commands/evolog.rs +++ b/cli/src/commands/evolog.rs @@ -42,6 +42,7 @@ pub(crate) struct EvologArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] revision: RevisionArg, diff --git a/cli/src/commands/file/annotate.rs b/cli/src/commands/file/annotate.rs index a57f580752..f239dc10ac 100644 --- a/cli/src/commands/file/annotate.rs +++ b/cli/src/commands/file/annotate.rs @@ -44,7 +44,12 @@ pub(crate) struct FileAnnotateArgs { )] path: String, /// an optional revision to start at - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] revision: Option, } diff --git a/cli/src/commands/file/chmod.rs b/cli/src/commands/file/chmod.rs index 886202b4b0..d61e528be0 100644 --- a/cli/src/commands/file/chmod.rs +++ b/cli/src/commands/file/chmod.rs @@ -49,6 +49,7 @@ pub(crate) struct FileChmodArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions), )] revision: RevisionArg, diff --git a/cli/src/commands/file/list.rs b/cli/src/commands/file/list.rs index d3315c8500..7ab6aef459 100644 --- a/cli/src/commands/file/list.rs +++ b/cli/src/commands/file/list.rs @@ -30,6 +30,7 @@ pub(crate) struct FileListArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] revision: RevisionArg, diff --git a/cli/src/commands/file/show.rs b/cli/src/commands/file/show.rs index 2f07ae9092..fdbae98375 100644 --- a/cli/src/commands/file/show.rs +++ b/cli/src/commands/file/show.rs @@ -48,6 +48,7 @@ pub(crate) struct FileShowArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::all_revisions), )] revision: RevisionArg, diff --git a/cli/src/commands/fix.rs b/cli/src/commands/fix.rs index ff9211edfe..b8c14ff22e 100644 --- a/cli/src/commands/fix.rs +++ b/cli/src/commands/fix.rs @@ -126,7 +126,12 @@ pub(crate) struct FixArgs { /// Fix files in the specified revision(s) and their descendants. If no /// revisions are specified, this defaults to the `revsets.fix` setting, or /// `reachable(@, mutable())` if it is not set. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] source: Vec, /// Fix only these paths #[arg(value_name = "FILESETS", value_hint = clap::ValueHint::AnyPath)] diff --git a/cli/src/commands/git/push.rs b/cli/src/commands/git/push.rs index 49004505a5..0bfea4a502 100644 --- a/cli/src/commands/git/push.rs +++ b/cli/src/commands/git/push.rs @@ -127,7 +127,7 @@ pub struct GitPushArgs { #[arg(long)] allow_private: bool, /// Push bookmarks pointing to these commits (can be repeated) - #[arg(long, short)] + #[arg(long, short, value_name = "REVSETS")] revisions: Vec, /// Push this commit by creating a bookmark based on its change ID (can be /// repeated) @@ -135,7 +135,7 @@ pub struct GitPushArgs { /// The created bookmark will be tracked automatically. Use the /// `git.push-bookmark-prefix` setting to change the prefix for generated /// names. - #[arg(long, short)] + #[arg(long, short, value_name = "REVSETS")] change: Vec, /// Only display what will change on the remote #[arg(long)] diff --git a/cli/src/commands/git/submodule.rs b/cli/src/commands/git/submodule.rs index c9e81a734a..f713d52754 100644 --- a/cli/src/commands/git/submodule.rs +++ b/cli/src/commands/git/submodule.rs @@ -52,7 +52,7 @@ pub fn cmd_git_submodule( #[command(hide = true)] pub struct PrintArgs { /// Read .gitmodules from the given revision. - #[arg(long, short = 'r', default_value = "@")] + #[arg(long, short = 'r', default_value = "@", value_name = "REVSET")] revisions: RevisionArg, } diff --git a/cli/src/commands/interdiff.rs b/cli/src/commands/interdiff.rs index a0b3e4afd0..871b1c63c0 100644 --- a/cli/src/commands/interdiff.rs +++ b/cli/src/commands/interdiff.rs @@ -37,10 +37,20 @@ use crate::ui::Ui; #[command(mut_arg("ignore_space_change", |a| a.short('b')))] pub(crate) struct InterdiffArgs { /// Show changes from this revision - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] from: Option, /// Show changes to this revision - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] to: Option, /// Restrict the diff to these paths #[arg( diff --git a/cli/src/commands/log.rs b/cli/src/commands/log.rs index 8f47117b7a..11eb95f02f 100644 --- a/cli/src/commands/log.rs +++ b/cli/src/commands/log.rs @@ -63,7 +63,12 @@ pub(crate) struct LogArgs { /// /// If no paths nor revisions are specified, this defaults to the /// `revsets.log` setting. - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::all_revisions) + )] revisions: Vec, /// Show revisions modifying the given paths #[arg( diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 486330b8e5..aa3a52e227 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -52,7 +52,11 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct NewArgs { /// Parent(s) of the new change - #[arg(default_value = "@", add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + default_value = "@", + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::all_revisions) + )] pub(crate) revisions: Vec, /// Ignored (but lets you pass `-d`/`-r` for consistency with other /// commands) @@ -73,6 +77,7 @@ pub(crate) struct NewArgs { short = 'A', visible_alias = "after", conflicts_with = "revisions", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] insert_after: Vec, @@ -82,6 +87,7 @@ pub(crate) struct NewArgs { short = 'B', visible_alias = "before", conflicts_with = "revisions", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::mutable_revisions), )] insert_before: Vec, diff --git a/cli/src/commands/parallelize.rs b/cli/src/commands/parallelize.rs index e252c60f68..8da5bca657 100644 --- a/cli/src/commands/parallelize.rs +++ b/cli/src/commands/parallelize.rs @@ -57,7 +57,10 @@ use crate::ui::Ui; #[command(verbatim_doc_comment)] pub(crate) struct ParallelizeArgs { /// Revisions to parallelize - #[arg(add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revisions: Vec, } diff --git a/cli/src/commands/rebase.rs b/cli/src/commands/rebase.rs index 0a71e74e85..b76729caae 100644 --- a/cli/src/commands/rebase.rs +++ b/cli/src/commands/rebase.rs @@ -142,7 +142,12 @@ pub(crate) struct RebaseArgs { /// -d=dst`. /// /// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] branch: Vec, /// Rebase specified revision(s) together with their trees of descendants @@ -153,7 +158,12 @@ pub(crate) struct RebaseArgs { /// of others. /// /// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] source: Vec, /// Rebase the given revisions, rebasing descendants onto this revision's /// parent(s) @@ -162,7 +172,12 @@ pub(crate) struct RebaseArgs { /// descendant of `A`. /// /// If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revisions: Vec, #[command(flatten)] @@ -185,7 +200,12 @@ pub(crate) struct RebaseArgs { pub struct RebaseDestinationArgs { /// The revision(s) to rebase onto (can be repeated to create a merge /// commit) - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::all_revisions) + )] destination: Option>, /// The revision(s) to insert after (can be repeated to create a merge /// commit) @@ -194,6 +214,7 @@ pub struct RebaseDestinationArgs { short = 'A', visible_alias = "after", conflicts_with = "destination", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::all_revisions), )] insert_after: Option>, @@ -204,6 +225,7 @@ pub struct RebaseDestinationArgs { short = 'B', visible_alias = "before", conflicts_with = "destination", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::mutable_revisions), )] insert_before: Option>, diff --git a/cli/src/commands/resolve.rs b/cli/src/commands/resolve.rs index f12ead62bc..fd4df8110e 100644 --- a/cli/src/commands/resolve.rs +++ b/cli/src/commands/resolve.rs @@ -48,6 +48,7 @@ pub(crate) struct ResolveArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions), )] revision: RevisionArg, diff --git a/cli/src/commands/restore.rs b/cli/src/commands/restore.rs index 60efffd0e4..bbe99c95b5 100644 --- a/cli/src/commands/restore.rs +++ b/cli/src/commands/restore.rs @@ -53,22 +53,32 @@ pub(crate) struct RestoreArgs { )] paths: Vec, /// Revision to restore from (source) - #[arg(long, short, add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] from: Option, /// Revision to restore into (destination) - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] to: Option, /// Undo the changes in a revision as compared to the merge of its parents. /// - /// This undoes the changes that can be seen with `jj diff -r REVISION`. If - /// `REVISION` only has a single parent, this option is equivalent to `jj - /// restore --to REVISION --from REVISION-`. + /// This undoes the changes that can be seen with `jj diff -r REVSET`. If + /// `REVSET` only has a single parent, this option is equivalent to `jj + /// restore --to REVSET --from REVSET-`. /// /// The default behavior of `jj restore` is equivalent to `jj restore /// --changes-in @`. #[arg( long, short, - value_name = "REVISION", + value_name = "REVSET", conflicts_with_all = ["to", "from"], add = ArgValueCandidates::new(complete::all_revisions), )] diff --git a/cli/src/commands/run.rs b/cli/src/commands/run.rs index 0cabb833fe..67d96adec1 100644 --- a/cli/src/commands/run.rs +++ b/cli/src/commands/run.rs @@ -40,7 +40,7 @@ pub struct RunArgs { /// The command to run across all selected revisions. shell_command: String, /// The revisions to change. - #[arg(long, short, default_value = "@")] + #[arg(long, short, default_value = "@", value_name = "REVSETS")] revisions: Vec, /// A no-op option to match the interface of `git rebase -x`. #[arg(short = 'x', hide = true)] diff --git a/cli/src/commands/show.rs b/cli/src/commands/show.rs index ec63b9c849..e7ff6c09f4 100644 --- a/cli/src/commands/show.rs +++ b/cli/src/commands/show.rs @@ -27,7 +27,11 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct ShowArgs { /// Show changes in this revision, compared to its parent(s) - #[arg(default_value = "@", add = ArgValueCandidates::new(complete::all_revisions))] + #[arg( + default_value = "@", + value_name = "REVSET", + add = ArgValueCandidates::new(complete::all_revisions) + )] revision: RevisionArg, /// Ignored (but lets you pass `-r` for consistency with other commands) #[arg(short = 'r', hide = true)] diff --git a/cli/src/commands/simplify_parents.rs b/cli/src/commands/simplify_parents.rs index c8205469b6..e31fff39ec 100644 --- a/cli/src/commands/simplify_parents.rs +++ b/cli/src/commands/simplify_parents.rs @@ -23,14 +23,24 @@ use crate::ui::Ui; pub(crate) struct SimplifyParentsArgs { /// Simplify specified revision(s) together with their trees of descendants /// (can be repeated) - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] source: Vec, /// Simplify specified revision(s) (can be repeated) /// /// If both `--source` and `--revisions` are not provided, this defaults to /// the `revsets.simplify-parents` setting, or `reachable(@, mutable())` /// if it is not set. - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSETS", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revisions: Vec, } diff --git a/cli/src/commands/split.rs b/cli/src/commands/split.rs index 1b7c984313..04a47d48cb 100644 --- a/cli/src/commands/split.rs +++ b/cli/src/commands/split.rs @@ -59,6 +59,7 @@ pub(crate) struct SplitArgs { #[arg( long, short, default_value = "@", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions) )] revision: RevisionArg, diff --git a/cli/src/commands/squash.rs b/cli/src/commands/squash.rs index 81ca33e5cf..cbc6d350ea 100644 --- a/cli/src/commands/squash.rs +++ b/cli/src/commands/squash.rs @@ -60,12 +60,18 @@ use crate::ui::Ui; #[derive(clap::Args, Clone, Debug)] pub(crate) struct SquashArgs { /// Revision to squash into its parent (default: @) - #[arg(long, short, add = ArgValueCandidates::new(complete::mutable_revisions))] + #[arg( + long, + short, + value_name = "REVSET", + add = ArgValueCandidates::new(complete::mutable_revisions) + )] revision: Option, /// Revision(s) to squash from (default: @) #[arg( long, short, conflicts_with = "revision", + value_name = "REVSETS", add = ArgValueCandidates::new(complete::mutable_revisions), )] from: Vec, @@ -74,6 +80,7 @@ pub(crate) struct SquashArgs { long, short = 't', conflicts_with = "revision", visible_alias = "to", + value_name = "REVSET", add = ArgValueCandidates::new(complete::mutable_revisions), )] into: Option, diff --git a/cli/src/commands/unsquash.rs b/cli/src/commands/unsquash.rs index d83911bb4c..593ce98c26 100644 --- a/cli/src/commands/unsquash.rs +++ b/cli/src/commands/unsquash.rs @@ -38,7 +38,7 @@ use crate::ui::Ui; /// commit. This is true in general; it is not specific to this command. #[derive(clap::Args, Clone, Debug)] pub(crate) struct UnsquashArgs { - #[arg(long, short, default_value = "@")] + #[arg(long, short, default_value = "@", value_name = "REVSET")] revision: RevisionArg, /// Interactively choose which parts to unsquash // TODO: It doesn't make much sense to run this without -i. We should make that diff --git a/cli/src/commands/workspace/add.rs b/cli/src/commands/workspace/add.rs index c77c97da46..e02ee49985 100644 --- a/cli/src/commands/workspace/add.rs +++ b/cli/src/commands/workspace/add.rs @@ -68,7 +68,7 @@ pub struct WorkspaceAddArgs { /// the new working-copy commit will be created with all these revisions as /// parents, i.e. the working-copy commit will exist as if you had run `jj /// new r1 r2 r3 ...`. - #[arg(long, short)] + #[arg(long, short, value_name = "REVSETS")] revision: Vec, /// How to handle sparse patterns when creating a new workspace. #[arg(long, value_enum, default_value_t = SparseInheritance::Copy)] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 65b1ca7d82..a5858dda8e 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -210,11 +210,11 @@ Abandon a revision, rebasing descendants onto its parent(s). The behavior is sim If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command. -**Usage:** `jj abandon [OPTIONS] [REVISIONS]...` +**Usage:** `jj abandon [OPTIONS] [REVSETS]...` ###### **Arguments:** -* `` — The revision(s) to abandon +* `` — The revision(s) to abandon Default value: `@` @@ -241,10 +241,10 @@ The modification made by `jj absorb` can be reviewed by `jj op show -p`. ###### **Options:** -* `-f`, `--from ` — Source revision to absorb from +* `-f`, `--from ` — Source revision to absorb from Default value: `@` -* `-t`, `--into ` — Destination revisions to absorb into +* `-t`, `--into ` — Destination revisions to absorb into Only ancestors of the source revision will be considered. @@ -260,10 +260,10 @@ Apply the reverse of a revision on top of another revision ###### **Options:** -* `-r`, `--revisions ` — The revision(s) to apply the reverse of +* `-r`, `--revisions ` — The revision(s) to apply the reverse of Default value: `@` -* `-d`, `--destination ` — The revision to apply the reverse changes on top of +* `-d`, `--destination ` — The revision to apply the reverse changes on top of Default value: `@` @@ -303,7 +303,7 @@ Create a new bookmark ###### **Options:** -* `-r`, `--revision ` — The bookmark's target revision +* `-r`, `--revision ` — The bookmark's target revision @@ -363,7 +363,7 @@ For information about bookmarks, see https://jj-vcs.github.io/jj/latest/bookmark By default, the specified remote name matches exactly. Use `glob:` prefix to select remotes by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns. * `-t`, `--tracked` — Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default * `-c`, `--conflicted` — Show conflicted bookmarks only -* `-r`, `--revisions ` — Show bookmarks whose local targets are in the given revisions +* `-r`, `--revisions ` — Show bookmarks whose local targets are in the given revisions Note that `-r deleted_bookmark` will not work since `deleted_bookmark` wouldn't have a local target. * `-T`, `--template