Skip to content

Commit

Permalink
Merge pull request #24 from ocaml-opam/strict-exit
Browse files Browse the repository at this point in the history
Be explicit that Ok values are not passed to `Term.exit`
  • Loading branch information
talex5 authored Dec 22, 2020
2 parents 06a8b6b + 5f45096 commit 0512f1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let atom =
let sversion = Re.Group.get sub 3 in
let name = OpamPackage.Name.of_string sname in
let sop = if sop = "." then "=" else sop in
let op = OpamLexer.relop sop in
let op = OpamLexer.FullPos.relop sop in
let version = OpamPackage.Version.of_string sversion in
`Ok (name, Some (op, version))
with Not_found | Failure _ | OpamLexer.Error _ ->
Expand Down Expand Up @@ -100,4 +100,4 @@ let cmd =
let () =
match Term.eval cmd with
| `Ok reason -> exit (OpamStd.Sys.get_exit_code reason)
| x -> Term.exit x
| `Error _ | `Help | `Version as x -> Term.exit x
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This package uses 0install's solver algorithm with opam packages.
opam-state
(ocaml (>= 4.08.0))
0install-solver
(opam-file-format (>= 2.1.1))
(opam-client :with-test)
(opam-solver :with-test)
(astring :with-test)
Expand Down
1 change: 1 addition & 0 deletions opam-0install.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ depends: [
"opam-state"
"ocaml" {>= "4.08.0"}
"0install-solver"
"opam-file-format" {>= "2.1.1"}
"opam-client" {with-test}
"opam-solver" {with-test}
"astring" {with-test}
Expand Down

0 comments on commit 0512f1a

Please sign in to comment.