diffedit: separate extra help information in its own paragraph

This commit is contained in:
Samuel Tardieu 2024-09-17 22:47:43 +02:00
parent a2e67bdd9b
commit 726cbbd66c
3 changed files with 23 additions and 13 deletions

View File

@ -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<RevisionArg>,
/// 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<RevisionArg>,
/// 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<RevisionArg>,
/// Specify diff editor to be used

View File

@ -657,9 +657,15 @@ See `jj restore` if you want to move entire files from one revision to another.
###### **Options:**
* `-r`, `--revision <REVISION>` — The revision to touch up. Defaults to @ if neither --to nor --from are specified
* `--from <FROM>` — Show changes from this revision. Defaults to @ if --to is specified
* `--to <TO>` — Edit changes in this revision. Defaults to @ if --from is specified
* `-r`, `--revision <REVISION>` — The revision to touch up
Defaults to @ if neither --to nor --from are specified.
* `--from <FROM>` — Show changes from this revision
Defaults to @ if --to is specified.
* `--to <TO>` — Edit changes in this revision
Defaults to @ if --from is specified.
* `--tool <NAME>` — Specify diff editor to be used

View File

@ -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 <REVISION> The revision to touch up. Defaults to @ if neither --to nor --from are
specified
--from <FROM> Show changes from this revision. Defaults to @ if --to is specified
--to <TO> Edit changes in this revision. Defaults to @ if --from is specified
-r, --revision <REVISION> The revision to touch up
--from <FROM> Show changes from this revision
--to <TO> Edit changes in this revision
--tool <NAME> 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 <TOML> Additional configuration options (can be repeated)
"###);
"#);
}
#[test]