sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Command-line handling.
type 'a args = {
context : 'a;
config_file : Fpath.t;
context_file : Fpath.t option;
output : string option;
dry_run : bool;
}
The type for global arguments.
val default_args : unit args
val peek_args :
?with_setup:bool ->
mname:string ->
string array ->
unit args option
peek_args ?with_setup argv
parses the global command-line arguments. If with_setup
is set (by default it is), interprets -v
and --color
to set-up the terminal configuration as a side-effect. Returns None if global command-line arguments are invalid.
peek_full_eval argv
reads the --output
option from argv
; the return value is None
if option is absent in argv
.
val pp_args : 'a Fmt.t -> 'a args Fmt.t
pp_args
is the pretty-printer for args.
The type for arguments of the configure
sub-command.
type 'a build_args = 'a args
The type for arguments of the build
sub-command.
type 'a clean_args = 'a args
The type for arguments of the clean
sub-command.
type 'a help_args = 'a args
The type for arguments of the help
sub-command.
val pp_query_kind : query_kind Fmt.t
pp_query_kind
is the pretty-printer for query kinds.
type 'a query_args = {
args : 'a args;
kind : query_kind;
depext : bool;
extra_repo : (string * string) list;
}
The type for arguments of the query
sub-command.
The type for arguments of the describe
sub-command.
peek_full_eval argv
reads the --eval
option from argv
; the return value is None
if option is absent in argv
.
type 'a action =
| Configure of 'a configure_args
| Query of 'a query_args
| Describe of 'a describe_args
| Build of 'a build_args
| Clean of 'a clean_args
| Help of 'a help_args
A value of type action
is the result of parsing command-line arguments using parse_args
.
val pp_action : 'a Fmt.t -> 'a action Fmt.t
pp_action
is the pretty-printer for actions.
val eval :
?with_setup:bool ->
?help_ppf:Stdlib.Format.formatter ->
?err_ppf:Stdlib.Format.formatter ->
name:string ->
version:string ->
configure:'a Cmdliner.Term.t ->
query:'a Cmdliner.Term.t ->
describe:'a Cmdliner.Term.t ->
build:'a Cmdliner.Term.t ->
clean:'a Cmdliner.Term.t ->
help:'a Cmdliner.Term.t ->
mname:string ->
string array ->
'a action Cmdliner.Term.result
Parse the functoria command line. The arguments to ~configure
, ~describe
, etc., describe extra command-line arguments that should be accepted by the corresponding subcommands.
There are no side effects, save for the printing of usage messages and other help when either the 'help' subcommand or no subcommand is specified.