-
Notifications
You must be signed in to change notification settings - Fork 470
Exit codes don't match help text #7296
Copy link
Copy link
Closed
Labels
docsDocumentation improvementsDocumentation improvements
Description
Expected Behavior
dune --help output says:
EXIT STATUS
dune exits with the following status:
0 on success.
123 on indiscriminate errors reported on standard error.
124 on command line parsing errors.
125 on unexpected internal errors (bugs).
This is the default from Cmdliner.
Actual Behavior
Possible exit codes are 0, 1 and 130:
Lines 90 to 106 in 449cbd3
| let exit_and_flush code = | |
| Console.finish (); | |
| exit code | |
| let () = | |
| Dune_rules.Colors.setup_err_formatter_colors (); | |
| try | |
| match Cmd.eval_value cmd ~catch:false with | |
| | Ok _ -> exit_and_flush 0 | |
| | Error _ -> exit_and_flush 1 | |
| with | |
| | Scheduler.Run.Shutdown.E Requested -> exit_and_flush 0 | |
| | Scheduler.Run.Shutdown.E (Signal _) -> exit_and_flush 130 | |
| | exn -> | |
| let exn = Exn_with_backtrace.capture exn in | |
| Dune_util.Report_error.report exn; | |
| exit_and_flush 1 |
Reproduction
- Run dune with invalid arguments:
dune --foo. - Check exit code:
echo $?– currently outputs 1, not 124.
Specifications
- Version of
dune(output ofdune --version): 3.7.0 - Version of
ocaml(output ofocamlc --version): 4.14.0 - Operating system (distribution and version): Xubuntu 22.04.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation improvementsDocumentation improvements