Skip to content

Commit 5597ea2

Browse files
committed
docs: use long-form flag names in command documentation
in clap, the visible_aliases, e.g. '[aliases: --after]' are shown at the very end, which makes it confusing if you're reading from top to bottom. aliases are currently omitted entirely from the man pages, making it confusing to see undocumented aliases being used.
1 parent 4100816 commit 5597ea2

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

cli/src/commands/new.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ pub(crate) struct NewArgs {
6868
_edit: bool,
6969
/// Insert the new change after the given commit(s)
7070
///
71-
/// Example: `jj new --after A` creates a new change between `A` and its
72-
/// children:
71+
/// Example: `jj new --insert-after A` creates a new change between `A` and
72+
/// its children:
7373
///
7474
/// ```text
7575
/// B C
@@ -79,11 +79,12 @@ pub(crate) struct NewArgs {
7979
/// A A
8080
/// ```
8181
///
82-
/// Specifying `--after` multiple times will relocate all children of the
83-
/// given commits.
82+
/// Specifying `--insert-after` multiple times will relocate all children of
83+
/// the given commits.
8484
///
85-
/// Example: `jj new --after A --after X` creates a change with `A` and `X`
86-
/// as parents, and rebases all children on top of the new change:
85+
/// Example: `jj new --insert-after A --insert-after X` creates a change
86+
/// with `A` and `X` as parents, and rebases all children on top of the new
87+
/// change:
8788
///
8889
/// ```text
8990
/// B Y
@@ -104,8 +105,8 @@ pub(crate) struct NewArgs {
104105
insert_after: Option<Vec<RevisionArg>>,
105106
/// Insert the new change before the given commit(s)
106107
///
107-
/// Example: `jj new --before C` creates a new change between `C` and its
108-
/// parents:
108+
/// Example: `jj new --insert-before C` creates a new change between `C` and
109+
/// its parents:
109110
///
110111
/// ```text
111112
/// C
@@ -115,9 +116,9 @@ pub(crate) struct NewArgs {
115116
/// A B A B
116117
/// ```
117118
///
118-
/// `--after` and `--before` can be combined.
119+
/// `--insert-after` and `--insert-before` can be combined.
119120
///
120-
/// Example: `jj new --after A --before D`:
121+
/// Example: `jj new --insert-after A --insert-before D`:
121122
///
122123
/// ```text
123124
///
@@ -130,7 +131,8 @@ pub(crate) struct NewArgs {
130131
/// A A
131132
/// ```
132133
///
133-
/// Similar to `--after`, you can specify `--before` multiple times.
134+
/// Similar to `--insert-after`, you can specify `--insert-before` multiple
135+
/// times.
134136
#[arg(
135137
long,
136138
short = 'B',

cli/src/commands/restore.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ use crate::ui::Ui;
3030

3131
/// Restore paths from another revision
3232
///
33-
/// That means that the paths get the same content in the destination (`--to`)
33+
/// That means that the paths get the same content in the destination (`--into`)
3434
/// as they had in the source (`--from`). This is typically used for undoing
3535
/// changes to some paths in the working copy (`jj restore <paths>`).
3636
///
37-
/// If only one of `--from` or `--to` is specified, the other one defaults to
37+
/// If only one of `--from` or `--into` is specified, the other one defaults to
3838
/// the working copy.
3939
///
40-
/// When neither `--from` nor `--to` is specified, the command restores into the
41-
/// working copy from its parent(s). `jj restore` without arguments is similar
42-
/// to `jj abandon`, except that it leaves an empty revision with its
40+
/// When neither `--from` nor `--into` is specified, the command restores into
41+
/// the working copy from its parent(s). `jj restore` without arguments is
42+
/// similar to `jj abandon`, except that it leaves an empty revision with its
4343
/// description and other metadata preserved.
4444
///
4545
/// See `jj diffedit` if you'd like to restore portions of files rather than

cli/tests/[email protected]

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,8 +1846,8 @@ Note that you can create a merge commit by specifying multiple revisions as argu
18461846
* `--no-edit` — Do not edit the newly created change
18471847
* `-A`, `--insert-after <REVSETS>` [alias: `after`] — Insert the new change after the given commit(s)
18481848

1849-
Example: `jj new --after A` creates a new change between `A` and its
1850-
children:
1849+
Example: `jj new --insert-after A` creates a new change between `A` and
1850+
its children:
18511851

18521852
```text
18531853
B C
@@ -1857,11 +1857,12 @@ Note that you can create a merge commit by specifying multiple revisions as argu
18571857
A A
18581858
```
18591859

1860-
Specifying `--after` multiple times will relocate all children of the
1861-
given commits.
1860+
Specifying `--insert-after` multiple times will relocate all children of
1861+
the given commits.
18621862

1863-
Example: `jj new --after A --after X` creates a change with `A` and `X`
1864-
as parents, and rebases all children on top of the new change:
1863+
Example: `jj new --insert-after A --insert-after X` creates a change
1864+
with `A` and `X` as parents, and rebases all children on top of the new
1865+
change:
18651866

18661867
```text
18671868
B Y
@@ -1872,8 +1873,8 @@ Note that you can create a merge commit by specifying multiple revisions as argu
18721873
```
18731874
* `-B`, `--insert-before <REVSETS>` [alias: `before`] — Insert the new change before the given commit(s)
18741875

1875-
Example: `jj new --before C` creates a new change between `C` and its
1876-
parents:
1876+
Example: `jj new --insert-before C` creates a new change between `C` and
1877+
its parents:
18771878

18781879
```text
18791880
C
@@ -1883,9 +1884,9 @@ Note that you can create a merge commit by specifying multiple revisions as argu
18831884
A B A B
18841885
```
18851886

1886-
`--after` and `--before` can be combined.
1887+
`--insert-after` and `--insert-before` can be combined.
18871888

1888-
Example: `jj new --after A --before D`:
1889+
Example: `jj new --insert-after A --insert-before D`:
18891890

18901891
```text
18911892

@@ -1898,7 +1899,8 @@ Note that you can create a merge commit by specifying multiple revisions as argu
18981899
A A
18991900
```
19001901

1901-
Similar to `--after`, you can specify `--before` multiple times.
1902+
Similar to `--insert-after`, you can specify `--insert-before` multiple
1903+
times.
19021904

19031905

19041906

@@ -2560,11 +2562,11 @@ Note that conflicts can also be resolved without using this command. You may edi
25602562

25612563
Restore paths from another revision
25622564

2563-
That means that the paths get the same content in the destination (`--to`) as they had in the source (`--from`). This is typically used for undoing changes to some paths in the working copy (`jj restore <paths>`).
2565+
That means that the paths get the same content in the destination (`--into`) as they had in the source (`--from`). This is typically used for undoing changes to some paths in the working copy (`jj restore <paths>`).
25642566

2565-
If only one of `--from` or `--to` is specified, the other one defaults to the working copy.
2567+
If only one of `--from` or `--into` is specified, the other one defaults to the working copy.
25662568

2567-
When neither `--from` nor `--to` is specified, the command restores into the working copy from its parent(s). `jj restore` without arguments is similar to `jj abandon`, except that it leaves an empty revision with its description and other metadata preserved.
2569+
When neither `--from` nor `--into` is specified, the command restores into the working copy from its parent(s). `jj restore` without arguments is similar to `jj abandon`, except that it leaves an empty revision with its description and other metadata preserved.
25682570

25692571
See `jj diffedit` if you'd like to restore portions of files rather than entire files.
25702572

0 commit comments

Comments
 (0)