diff --git a/cli/src/commands/diffedit.rs b/cli/src/commands/diffedit.rs index 2e0d70f08a..d5f52b69dc 100644 --- a/cli/src/commands/diffedit.rs +++ b/cli/src/commands/diffedit.rs @@ -46,14 +46,19 @@ use crate::ui::Ui; /// changes into or out of the parent revision. #[derive(clap::Args, Clone, Debug)] pub(crate) struct DiffeditArgs { - /// The revision to touch up. Defaults to @ if neither --to nor --from are - /// specified. + /// The revision to touch up + /// + /// Defaults to @ if neither --to nor --from are specified. #[arg(long, short)] revision: Option, - /// Show changes from this revision. Defaults to @ if --to is specified. + /// Show changes from this revision + /// + /// Defaults to @ if --to is specified. #[arg(long, conflicts_with = "revision")] from: Option, - /// Edit changes in this revision. Defaults to @ if --from is specified. + /// Edit changes in this revision + /// + /// Defaults to @ if --from is specified. #[arg(long, conflicts_with = "revision")] to: Option, /// Specify diff editor to be used diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 78da14387d..d2a4d709aa 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -657,9 +657,15 @@ See `jj restore` if you want to move entire files from one revision to another. ###### **Options:** -* `-r`, `--revision ` — The revision to touch up. Defaults to @ if neither --to nor --from are specified -* `--from ` — Show changes from this revision. Defaults to @ if --to is specified -* `--to ` — Edit changes in this revision. Defaults to @ if --from is specified +* `-r`, `--revision ` — The revision to touch up + + Defaults to @ if neither --to nor --from are specified. +* `--from ` — Show changes from this revision + + Defaults to @ if --to is specified. +* `--to ` — Edit changes in this revision + + Defaults to @ if --from is specified. * `--tool ` — Specify diff editor to be used diff --git a/cli/tests/test_global_opts.rs b/cli/tests/test_global_opts.rs index adddf21048..b275f7109f 100644 --- a/cli/tests/test_global_opts.rs +++ b/cli/tests/test_global_opts.rs @@ -592,16 +592,15 @@ fn test_help() { let test_env = TestEnvironment::default(); let stdout = test_env.jj_cmd_success(test_env.env_root(), &["diffedit", "-h"]); - insta::assert_snapshot!(stdout, @r###" + insta::assert_snapshot!(stdout, @r#" Touch up the content changes in a revision with a diff editor Usage: jj diffedit [OPTIONS] Options: - -r, --revision The revision to touch up. Defaults to @ if neither --to nor --from are - specified - --from Show changes from this revision. Defaults to @ if --to is specified - --to Edit changes in this revision. Defaults to @ if --from is specified + -r, --revision The revision to touch up + --from Show changes from this revision + --to Edit changes in this revision --tool Specify diff editor to be used -h, --help Print help (see more with '--help') @@ -615,7 +614,7 @@ fn test_help() { --quiet Silence non-primary command output --no-pager Disable the pager --config-toml Additional configuration options (can be repeated) - "###); + "#); } #[test]