Skip to content

Commit 5cb39f6

Browse files
authored
feat: remove <name> <version> header from help text (#380)
1 parent b746dca commit 5cb39f6

7 files changed

+0
-29
lines changed

src/command/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,6 @@ impl Command {
684684
impl Command {
685685
pub(crate) fn render_help(&self, wrap_width: Option<usize>) -> String {
686686
let mut output = vec![];
687-
if self.version.is_some() {
688-
output.push(self.render_version());
689-
}
690687
if !&self.describe.is_empty() {
691688
output.push(render_block("", &self.describe, wrap_width));
692689
}

tests/snapshots/integration__multiline__nowrap.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog -h
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
How to use multiline help text
1211

1312
Extra lines after the comment tag accepts description, which don't start with an `@`,
@@ -43,7 +42,6 @@ EOF
4342
exit 0
4443

4544
# BUILD_OUTPUT
46-
prog 1.0.0
4745
How to use multiline help text
4846

4947
Extra lines after the comment tag accepts description, which don't start with an `@`,

tests/snapshots/integration__multiline__wrap.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog -h
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
How to use multiline help text
1211

1312
Extra lines after the comment tag accepts description, which don't start with
@@ -53,7 +52,6 @@ EOF
5352
exit 0
5453

5554
# BUILD_OUTPUT
56-
prog 1.0.0
5755
How to use multiline help text
5856

5957
Extra lines after the comment tag accepts description, which don't start with an `@`,

tests/snapshots/integration__multiline__wrap2.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog foo -h
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
How to use multiline help text
1211

1312
Extra lines after the comment tag accepts description, which don't start with
@@ -53,7 +52,6 @@ EOF
5352
exit 0
5453

5554
# BUILD_OUTPUT
56-
prog 1.0.0
5755
How to use multiline help text
5856

5957
Extra lines after the comment tag accepts description, which don't start with an `@`,

tests/snapshots/integration__validate__help_version.snap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog help
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
Test argc
1211

1312
USAGE: prog
@@ -16,7 +15,6 @@ EOF
1615
exit 0
1716

1817
# RUN_OUTPUT
19-
prog 1.0.0
2018
Test argc
2119

2220
USAGE: prog
@@ -26,7 +24,6 @@ prog --help
2624

2725
# OUTPUT
2826
command cat >&2 <<-'EOF'
29-
prog 1.0.0
3027
Test argc
3128

3229
USAGE: prog
@@ -35,7 +32,6 @@ EOF
3532
exit 0
3633

3734
# RUN_OUTPUT
38-
prog 1.0.0
3935
Test argc
4036

4137
USAGE: prog
@@ -45,7 +41,6 @@ prog -help
4541

4642
# OUTPUT
4743
command cat >&2 <<-'EOF'
48-
prog 1.0.0
4944
Test argc
5045

5146
USAGE: prog
@@ -54,7 +49,6 @@ EOF
5449
exit 0
5550

5651
# RUN_OUTPUT
57-
prog 1.0.0
5852
Test argc
5953

6054
USAGE: prog
@@ -64,7 +58,6 @@ prog -h
6458

6559
# OUTPUT
6660
command cat >&2 <<-'EOF'
67-
prog 1.0.0
6861
Test argc
6962

7063
USAGE: prog
@@ -73,7 +66,6 @@ EOF
7366
exit 0
7467

7568
# RUN_OUTPUT
76-
prog 1.0.0
7769
Test argc
7870

7971
USAGE: prog

tests/snapshots/integration__validate__help_version_exist.snap

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog -h
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
Test argc
1211

1312
USAGE: prog [OPTIONS]
@@ -20,7 +19,6 @@ EOF
2019
exit 0
2120

2221
# RUN_OUTPUT
23-
prog 1.0.0
2422
Test argc
2523

2624
USAGE: prog [OPTIONS]
@@ -40,5 +38,3 @@ exit 0
4038

4139
# RUN_OUTPUT
4240
prog 1.0.0
43-
44-

tests/snapshots/integration__validate__help_version_legacy.snap

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ prog help
77

88
# OUTPUT
99
command cat >&2 <<-'EOF'
10-
prog 1.0.0
1110
Test argc
1211

1312
USAGE: prog
@@ -16,7 +15,6 @@ EOF
1615
exit 0
1716

1817
# RUN_OUTPUT
19-
prog 1.0.0
2018
Test argc
2119

2220
USAGE: prog
@@ -26,7 +24,6 @@ prog --help
2624

2725
# OUTPUT
2826
command cat >&2 <<-'EOF'
29-
prog 1.0.0
3027
Test argc
3128

3229
USAGE: prog
@@ -35,7 +32,6 @@ EOF
3532
exit 0
3633

3734
# RUN_OUTPUT
38-
prog 1.0.0
3935
Test argc
4036

4137
USAGE: prog
@@ -45,7 +41,6 @@ prog -help
4541

4642
# OUTPUT
4743
command cat >&2 <<-'EOF'
48-
prog 1.0.0
4944
Test argc
5045

5146
USAGE: prog
@@ -54,7 +49,6 @@ EOF
5449
exit 0
5550

5651
# RUN_OUTPUT
57-
prog 1.0.0
5852
Test argc
5953

6054
USAGE: prog
@@ -64,7 +58,6 @@ prog -h
6458

6559
# OUTPUT
6660
command cat >&2 <<-'EOF'
67-
prog 1.0.0
6861
Test argc
6962

7063
USAGE: prog
@@ -73,7 +66,6 @@ EOF
7366
exit 0
7467

7568
# RUN_OUTPUT
76-
prog 1.0.0
7769
Test argc
7870

7971
USAGE: prog

0 commit comments

Comments
 (0)