Update Cmdliner with breaking changes

This commit is contained in:
Denis Merigoux 2022-02-10 22:57:07 +01:00
parent 5004929a51
commit b6d9d7cf5f
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
7 changed files with 1491 additions and 1537 deletions

View File

@ -81,8 +81,8 @@ let info =
`P "Please file bug reports at https://github.com/CatalaLang/catala/issues";
]
in
let exits = Term.default_exits @ [ Term.exit_info ~doc:"on error." 1 ] in
Term.info "clerk" ~version ~doc ~exits ~man
let exits = Cmd.Exit.defaults @ [ Cmd.Exit.info ~doc:"on error." 1 ] in
Cmd.info "clerk" ~version ~doc ~exits ~man
(**{1 Testing}*)
@ -328,7 +328,5 @@ let driver (file_or_folder : string) (command : string) (catala_exe : string opt
1
let _ =
let return_code = Cmdliner.Term.eval (clerk_t driver, info) in
match return_code with
| `Ok 0 -> Cmdliner.Term.exit (`Ok 0)
| _ -> Cmdliner.Term.exit (`Error `Term)
let return_code = Cmdliner.Cmd.eval' (Cmdliner.Cmd.v info (clerk_t driver)) in
exit return_code

View File

@ -303,7 +303,7 @@ let driver (source_file : Pos.input_file) (debug : bool) (unstyled : bool)
-1
let main () =
let return_code = Cmdliner.Term.eval (Cli.catala_t (fun f -> driver (FileName f)), Cli.info) in
match return_code with
| `Ok 0 -> Cmdliner.Term.exit (`Ok 0)
| _ -> Cmdliner.Term.exit (`Error `Term)
let return_code =
Cmdliner.Cmd.eval' (Cmdliner.Cmd.v Cli.info (Cli.catala_t (fun f -> driver (FileName f))))
in
exit return_code

View File

@ -179,8 +179,8 @@ let info =
`P "Please file bug reports at https://github.com/CatalaLang/catala/issues";
]
in
let exits = Term.default_exits @ [ Term.exit_info ~doc:"on error." 1 ] in
Term.info "catala" ~version ~doc ~exits ~man
let exits = Cmd.Exit.defaults @ [ Cmd.Exit.info ~doc:"on error." 1 ] in
Cmd.info "catala" ~version ~doc ~exits ~man
(**{1 Terminal formatting}*)

View File

@ -92,7 +92,7 @@ val catala_t :
val version : string
val info : Cmdliner.Term.info
val info : Cmdliner.Cmd.info
(**{1 Terminal formatting}*)

View File

@ -43,7 +43,7 @@
(bindlib
(>= 5.0.1))
(cmdliner
(>= 1.0.4))
(>= 1.1.0))
(re
(>= 1.9.0))
(zarith

File diff suppressed because one or more lines are too long

View File

@ -1,40 +1,8 @@
{
"name": "french_law",
"version": "0.5.0",
"lockfileVersion": 2,
"lockfileVersion": 1,
"requires": true,
"packages": {
"": {
"name": "french_law",
"version": "0.5.0",
"license": "Apache-2.0",
"dependencies": {
"benchmark": "^2.1.4",
"lodash": "^4.17.21",
"platform": "^1.3.6"
},
"devDependencies": {}
},
"node_modules/benchmark": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz",
"integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=",
"dependencies": {
"lodash": "^4.17.4",
"platform": "^1.3.3"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/platform": {
"version": "1.3.6",
"resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
"integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
}
},
"dependencies": {
"benchmark": {
"version": "2.1.4",