Module Cmdliner_base
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::cmdlinerlibrary to any desired targets insrc/*/CMakeLists.txt:target_link_libraries(YourPackage_YourLibraryName # ... existing libraries, if any ... Findlib::cmdliner)Click your IDE's
Buildbutton
Not using DkSDK?
FIRST, do one or all of the following:
Run:
opam install cmdliner.1.1.1+duneEdit your
dune-projectand add:(package (name YourExistingPackage) (depends ; ... existing dependenices ... (cmdliner (>= 1.1.1+dune))))Then run:
dune build *.opam # if this fails, run: dune buildEdit your
<package>.opamfile 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))valuid : ``unit->int
uid () is new unique for the program run.
valsuggest : ``string->``string list``->``string list
suggest near candidates suggest values from candidates not too far
from near.
Formatting helpers
valpp_text :Stdlib.Format.formatter->``string->unit
valpp_lines :Stdlib.Format.formatter->``string->unit
valpp_tokens : ``spaces:bool->Stdlib.Format.formatter->``string->unit
Error message helpers
valquote : ``string->string
valalts_str : ``?quoted:bool->``string list``->string
valerr_ambiguous : ``kind:string->``string->``ambs:``string list``->string
valerr_unknown : ``?dom:``string list``->``?hints:``string list``->``kind:string->``string->string
valerr_multi_def : ``kind:string->``string->``('b->string)``->'b->'b->string
Textual OCaml value converters
type``'a parser`` = ``string->``[ ```Ok of ````'a``` |Error ``` of string ```` ]`
type``'a printer`` =Stdlib.Format.formatter->'a->unit
valbool : ``boolconv
valchar : ``charconv
valint : ``intconv
valnativeint : ``nativeintconv
valint32 : ``int32conv
valint64 : ``int64conv
valfloat : ``floatconv
valstring : ``stringconv
valenum : ``(string *'a)`` list``->'aconv
valfile : ``stringconv
valdir : ``stringconv
valnon_dir_file : ``stringconv
valenv_bool_parse : ``boolparser
