Module Cmdliner_term_deprecated
Contents
Instructions: Use this module in your project
In the IDE (CLion, Visual Studio Code, Xcode, etc.) you use for your DkSDK project:
Add the following to your project's
dependencies/CMakeLists.txt
:DkSDKProject_DeclareAvailable(cmdliner CONSTRAINT "= 1.1.1+dune" FINDLIBS cmdliner) DkSDKProject_MakeAvailable(cmdliner)
Add the
Findlib::cmdliner
library to any desired targets insrc/*/CMakeLists.txt
:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::cmdliner)
Click your IDE's
Build
button
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install cmdliner.1.1.1+dune
Edit your
dune-project
and add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (cmdliner (>= 1.1.1+dune))))
Then run:
dune build *.opam # if this fails, run: dune build
Edit your
<package>.opam
file and add:depends: [ # ... existing dependencies ... "cmdliner" {>= "1.1.1+dune"} ]
Then run:
opam install . --deps-only
FINALLY, add the cmdliner
library to any desired (library)
and/or (executable)
targets in your **/dune
files:
(library
(name YourLibrary)
; ... existing library options ...
(libraries
; ... existing libraries ...
cmdliner))
(executable
(name YourExecutable)
; ... existing executable options ...
(libraries
; ... existing libraries ...
cmdliner))
val
man_format :
Cmdliner_manpage.format
Cmdliner_term.t
val
pure :
'a
->
'a
Cmdliner_term.t
type
exit_info`` =
Cmdliner_info.Exit.info
val
exit_info : ``?docs:string
->
``?doc:string
->
``?max:
Cmdliner_info.Exit.code
->
Cmdliner_info.Exit.code
->
Cmdliner_info.Exit.info
val
exit_status_success :
Cmdliner_info.Exit.code
val
exit_status_cli_error :
Cmdliner_info.Exit.code
val
exit_status_internal_error :
Cmdliner_info.Exit.code
val
default_error_exits :
Cmdliner_info.Exit.info
list
val
default_exits :
Cmdliner_info.Exit.info
list
type
env_info`` =
Cmdliner_info.Env.info
val
env_info : ``?docs:string
->
``?doc:string
->
Cmdliner_info.Env.var
->
Cmdliner_info.Env.info
type
info`` =
Cmdliner_info.Cmd.t
val
info : ``?man_xrefs:
Cmdliner_manpage.xref
list``
->
``?man:
Cmdliner_manpage.block
list``
->
``?envs:
Cmdliner_info.Env.info
list``
->
``?exits:
Cmdliner_info.Exit.info
list``
->
``?sdocs:string
->
``?docs:string
->
``?doc:string
->
``?version:string
->
``string
->
Cmdliner_info.Cmd.t
val
name :
Cmdliner_info.Cmd.t
->
string
type
``'a result`` = ``[
| ```
Ok ``of
'a
| ```
Error ``of
``` [
Parse ```` |Term ``` ``` |
Exn ``` ]`
| ```
Version ``
| ```
Help ``]
val
to_legacy_result : ``(``[<
'a
Cmdliner_eval.eval_ok
]``, ``` [
Exn ```` |Parse ``` ``` |
Term ``` ])
[
result](../../ocaml/Stdlib/#type-result)
`->
'a0
[
result\
](#type-result)
val
eval : ``?help:
Stdlib.Format.formatter
->
``?err:
Stdlib.Format.formatter
->
``?catch:bool
->
``?env:``(``string
->
``string option``)``
->
``?argv:``string array``
->
``(
'a
Cmdliner_term.t
*
Cmdliner_cmd.info
)``
->
'b
result
val
eval_choice : ``?help:
Stdlib.Format.formatter
->
``?err:
Stdlib.Format.formatter
->
``?catch:bool
->
``?env:``(``string
->
``string option``)``
->
``?argv:``string array``
->
``(
'a
Cmdliner_term.t
*
Cmdliner_cmd.info
)``
->
``(
'b
Cmdliner_term.t
*
Cmdliner_cmd.info
)`` list``
->
'c
result
val
eval_peek_opts : ``?version_opt:bool
->
``?env:``(``string
->
``string option``)``
->
``?argv:``string array``
->
'a
Cmdliner_term.t
->
'a
option`` *
'b
result
val
exit_status_of_result : ``?term_err:
Cmdliner_info.Exit.code
->
``[< ```
Error of[< `Exn
|Parse ``` ``` |
Term]``
|Help ``` ``` |
Okof unit``
|Version ``` ]``
->
Cmdliner_info.Exit.code
val
exit_status_of_status_result : ``?term_err:
Cmdliner_info.Exit.code
->
``[< ```
Error of[< `Exn
|Parse ``` ``` |
Term]``
|Help ``` ``` |
Okof `[`Cmdliner_info.Exit.code`](../Cmdliner_info-Exit/#type-code)`
|Version ``` ]``
->
Cmdliner_info.Exit.code
val
stdlib_exit : ``int
->
'a
val
exit : ``?term_err:
Cmdliner_info.Exit.code
->
``[< ```
Error of[< `Exn
|Parse ``` ``` |
Term]``
|Help ``` ``` |
Okof unit``
|Version ``` ]``
->
'a
val
exit_status : ``?term_err:
Cmdliner_info.Exit.code
->
``[< ```
Error of[< `Exn
|Parse ``` ``` |
Term]``
|Help ``` ``` |
Okof `[`Cmdliner_info.Exit.code`](../Cmdliner_info-Exit/#type-code)`
|Version ``` ]``
->
'a