Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3f240c7

Browse files
committedSep 23, 2022
Remove command name patch
1 parent b30b88c commit 3f240c7

File tree

10 files changed

+34
-39
lines changed

10 files changed

+34
-39
lines changed
 

‎test/blackbox-tests/test-cases/cmdline/profile.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Bug #4632
22

33
$ dune build -p
4-
dune build: option '-p' needs an argument
4+
dune: option '-p' needs an argument
55
Usage: dune build [OPTION]… [TARGET]…
66
Try 'dune build --help' or 'dune --help' for more information.
77
[1]

‎test/blackbox-tests/test-cases/cmdliner-dep-conf.t/run.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
[1]
1515

1616
$ dune build "(fi"
17-
dune build: TARGET… arguments: unclosed parenthesis at end of input
17+
dune: TARGET… arguments: unclosed parenthesis at end of input
1818
Usage: dune build [OPTION]… [TARGET]…
1919
Try 'dune build --help' or 'dune --help' for more information.
2020
[1]
2121

2222
$ dune build "()"
23-
dune build: TARGET… arguments: Unexpected list
23+
dune: TARGET… arguments: Unexpected list
2424
Usage: dune build [OPTION]… [TARGET]…
2525
Try 'dune build --help' or 'dune --help' for more information.
2626
[1]

‎test/blackbox-tests/test-cases/describe.t

+4-4
Original file line numberDiff line numberDiff line change
@@ -1323,10 +1323,10 @@ Test errors
13231323
[1]
13241324

13251325
$ dune describe --lang 1.0
1326-
dune describe: Only --lang 0.1 is available at the moment as this command is not yet
1327-
stabilised. If you would like to release a software that relies on the output
1328-
of 'dune describe', please open a ticket on
1329-
https://github.com/ocaml/dune.
1326+
dune: Only --lang 0.1 is available at the moment as this command is not yet
1327+
stabilised. If you would like to release a software that relies on the output
1328+
of 'dune describe', please open a ticket on
1329+
https://github.com/ocaml/dune.
13301330
Usage: dune describe [OPTION]… [STRING]…
13311331
Try 'dune describe --help' or 'dune --help' for more information.
13321332
[1]

‎test/blackbox-tests/test-cases/dune-init.t/run.t

+6-7
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,10 @@ Comments in dune files are preserved
251251
Will not create components with invalid names
252252

253253
$ dune init lib invalid-component-name ./_test_lib
254-
dune init: NAME argument: invalid component name
255-
`invalid-component-name'
256-
Library names must be non-empty and composed only of the
257-
following
258-
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
254+
dune: NAME argument: invalid component name `invalid-component-name'
255+
Library names must be non-empty and composed only of the
256+
following
257+
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
259258
Usage: dune init [OPTION]… COMPONENT NAME [PATH]
260259
Try 'dune init --help' or 'dune --help' for more information.
261260
[1]
@@ -265,8 +264,8 @@ Will not create components with invalid names
265264
Will fail and inform user when invalid component command is given
266265

267266
$ dune init foo blah
268-
dune init: COMPONENT argument: invalid value 'foo', expected one of
269-
'executable', 'library', 'project' or 'test'
267+
dune: COMPONENT argument: invalid value 'foo', expected one of 'executable',
268+
'library', 'project' or 'test'
270269
Usage: dune init [OPTION]… COMPONENT NAME [PATH]
271270
Try 'dune init --help' or 'dune --help' for more information.
272271
[1]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
external-lib-deps is no more.
22

33
$ dune external-lib-deps
4-
dune external-lib-deps: This subcommand is no longer implemented.
4+
dune: This subcommand is no longer implemented.
55
[1]

‎test/blackbox-tests/test-cases/github3046.t

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@ are given as parameters
77
`dune init exe main --libs="str gsl"` returns an informative parsing error
88

99
$ dune init exe main --libs="str gsl"
10-
dune init: option '--libs': invalid element in list ('str gsl'): expected a
11-
valid dune atom
10+
dune: option '--libs': invalid element in list ('str gsl'): expected a valid
11+
dune atom
1212
Usage: dune init [OPTION]… COMPONENT NAME [PATH]
1313
Try 'dune init --help' or 'dune --help' for more information.
1414
[1]
1515

1616
`dune init lib foo --ppx="foo bar"` returns an informative parsing error
1717

1818
$ dune init lib foo --ppx="foo bar"
19-
dune init: option '--ppx': invalid element in list ('foo bar'): expected a
20-
valid dune atom
19+
dune: option '--ppx': invalid element in list ('foo bar'): expected a valid
20+
dune atom
2121
Usage: dune init [OPTION]… COMPONENT NAME [PATH]
2222
Try 'dune init --help' or 'dune --help' for more information.
2323
[1]
2424

2525
`dune init lib foo --public="some/invalid&name!"` returns an informative parsing error
2626

2727
$ dune init lib foo --public="some/invalid&name!"
28-
dune init: option '--public': invalid component name
29-
`some/invalid&name!'
30-
Library names must be non-empty and composed only of the
31-
following
32-
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
28+
dune: option '--public': invalid component name `some/invalid&name!'
29+
Library names must be non-empty and composed only of the
30+
following
31+
characters: 'A'..'Z', 'a'..'z', '_' or '0'..'9'.
3332
Usage: dune init [OPTION]… COMPONENT NAME [PATH]
3433
Try 'dune init --help' or 'dune --help' for more information.
3534
[1]

‎test/blackbox-tests/test-cases/github3530.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ When an empty string is passed to `-p`, we get a nice error message.
22

33
$ echo '(lang dune 2.0)' > dune-project
44
$ dune build -p ''
5-
dune build: option '--only-packages': Invalid package name: ""
5+
dune: option '--only-packages': Invalid package name: ""
66
Usage: dune build [OPTION]… [TARGET]…
77
Try 'dune build --help' or 'dune --help' for more information.
88
[1]
99

1010
This can happen in a list as well:
1111

1212
$ dune build -p 'a,b,'
13-
dune build: option '--only-packages': Invalid package name: ""
13+
dune: option '--only-packages': Invalid package name: ""
1414
Usage: dune build [OPTION]… [TARGET]…
1515
Try 'dune build --help' or 'dune --help' for more information.
1616
[1]

‎test/blackbox-tests/test-cases/misc.t/run.t

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ Test that incompatible options are properly reported
66
----------------------------------------------------
77

88
$ dune build --verbose --display quiet
9-
dune build: Cannot use --verbose and --display simultaneously
9+
dune: Cannot use --verbose and --display simultaneously
1010
Usage: dune build [OPTION]… [TARGET]…
1111
Try 'dune build --help' or 'dune --help' for more information.
1212
[1]
1313

1414
$ dune build -p toto --root .
15-
dune build: option '--root' cannot be repeated
15+
dune: option '--root' cannot be repeated
1616
Usage: dune build [OPTION]… [TARGET]…
1717
Try 'dune build --help' or 'dune --help' for more information.
1818
[1]
1919

2020
$ dune build --for-release-of-packages toto --root .
21-
dune build: option '--root' cannot be repeated
21+
dune: option '--root' cannot be repeated
2222
Usage: dune build [OPTION]… [TARGET]…
2323
Try 'dune build --help' or 'dune --help' for more information.
2424
[1]
2525

2626
$ dune build --no-config --config x
27-
dune build: Cannot use --config and --no-config simultaneously
27+
dune: Cannot use --config and --no-config simultaneously
2828
Usage: dune build [OPTION]… [TARGET]…
2929
Try 'dune build --help' or 'dune --help' for more information.
3030
[1]
3131

3232
$ dune build -p toto --release
33-
dune build: option '--root' cannot be repeated
33+
dune: option '--root' cannot be repeated
3434
Usage: dune build [OPTION]… [TARGET]…
3535
Try 'dune build --help' or 'dune --help' for more information.
3636
[1]
3737

3838
$ dune build --release --root .
39-
dune build: option '--root' cannot be repeated
39+
dune: option '--root' cannot be repeated
4040
Usage: dune build [OPTION]… [TARGET]…
4141
Try 'dune build --help' or 'dune --help' for more information.
4242
[1]

‎vendor/cmdliner/src/cmdliner_msg.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,16 @@ let err_cmd_missing ~dom =
7171

7272
(* Other messages *)
7373

74-
let cmds ei =
75-
let rcmds = Cmdliner_info.Eval.(cmd ei :: parents ei) in
76-
List.rev_map Cmdliner_info.Cmd.name rcmds
77-
78-
let exec_name ei = String.concat " " (cmds ei)
74+
let exec_name ei = Cmdliner_info.Cmd.name @@ Cmdliner_info.Eval.main ei
7975

8076
let pp_version ppf ei =
8177
match Cmdliner_info.Cmd.version @@ Cmdliner_info.Eval.main ei with
8278
| None -> assert false
8379
| Some v -> pp ppf "@[%a@]@." Cmdliner_base.pp_text v
8480

8581
let pp_try_help ppf ei =
86-
match cmds ei with
82+
let rcmds = Cmdliner_info.Eval.(cmd ei :: parents ei) in
83+
match List.rev_map Cmdliner_info.Cmd.name rcmds with
8784
| [] -> assert false
8885
| [n] -> pp ppf "@[<2>Try '%s --help' for more information.@]" n
8986
| n :: _ as cmds ->

‎vendor/update-cmdliner.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
version=2a903a2b833d4e58188eb5707e2a265064bf70d6
3+
version=e9d28b2f3d020eb14f1ae09fc53b536ec70833d5
44

55
set -e -o pipefail
66

0 commit comments

Comments
 (0)
Please sign in to comment.