Module Cmdline


module Cmdline: sig .. end
Command line parsing.


Stage configurations

Frama-C uses several stages for parsing its command line. Each of them may be customized.

type stage =
| Early
| Extending
| Extended
| Exiting
| Loading
| Configuring (*The different stages, from the first to be executed to the last one.*)

val run_after_early_stage : (unit -> unit) -> unit
Register an action to be executed at the end of the early stage.
Since Beryllium-20090901
Consult the Plugin Development Guide for additional details.
val run_during_extending_stage : (unit -> unit) -> unit
Register an action to be executed during the extending stage.
Since Beryllium-20090901
Consult the Plugin Development Guide for additional details.
val run_after_extended_stage : (unit -> unit) -> unit
Register an action to be executed at the end of the extending stage.
Since Beryllium-20090901
Consult the Plugin Development Guide for additional details.
type exit 
Since Beryllium-20090901
val nop : exit
Since Beryllium-20090901
Consult the Plugin Development Guide for additional details.
exception Exit
Since Beryllium-20090901
Consult the Plugin Development Guide for additional details.
val run_after_exiting_stage : (unit -> exit) -> unit
Register an action to be executed at the end of the exiting stage. The guarded action must finish by exit n.
Since Beryllium-20090601-beta1
Consult the Plugin Development Guide for additional details.
val run_after_loading_stage : (unit -> unit) -> unit
Register an action to be executed at the end of the loading stage.
Since Beryllium-20090601-beta1
Consult the Plugin Development Guide for additional details.
val is_going_to_load : unit -> unit
To be call if one action is going to run after the loading stage. It is not necessary to call this function if the running action if set by an option put on the command line.
Since Beryllium-20090601-beta1
Consult the Plugin Development Guide for additional details.
val run_after_configuring_stage : (unit -> unit) -> unit
Register an action to be executed at the end of the configuring stage.
Since Beryllium-20090601-beta1
Consult the Plugin Development Guide for additional details.
val catch_toplevel_run : (unit -> unit) -> (unit -> unit) -> unit

Special functions

These functions should not be used by a standard plug-in developer.

val parse_and_boot : (unit -> (unit -> unit) -> unit) -> (unit -> unit) -> unit
Not for casual users. parse_and_boot get_toplevel play performs the parsing of the command line, then play the analysis with the good toplevel provided by get_toplevel.
Since Beryllium-20090901
val nb_given_options : unit -> int
Number of options provided by the user on the command line. Should not be called before the end of the command line parsing.
Since Beryllium-20090601-beta1
val use_cmdline_files : (string list -> unit) -> unit
What to do with the list of files put on the command lines.
Since Beryllium-20090601-beta1
val help : unit -> exit
Display the help of Frama-C
Since Beryllium-20090601-beta1
val plugin_help : string -> exit
Display the help of the given plug-in (given by its shortname).
Since Beryllium-20090601-beta1
val add_plugin : ?short:string -> string -> descr:string -> unit
add_plugin ~short name ~descr adds a new plug-in recognized by the command line of Frama-C. If the shortname is not specified, then the name is used as the shortname. By convention, if the name and the shortname are equal to "", then the register "plug-in" is the Frama-C kernel itself.
Since Beryllium-20090601-beta1
module Group: sig .. end

type option_setting =
| Unit of (unit -> unit)
| Int of (int -> unit)
| String of (string -> unit)
| String_list of (string list -> unit)
Since Beryllium-20090601-beta1
val add_option : ?prefix:bool ->
string ->
plugin:string ->
group:Group.t ->
stage ->
?argname:string ->
descr:string option ->
ext_descr:(unit, Format.formatter, unit) Pervasives.format ->
option_setting -> unit
add_option ~prefix name ~plugin stage ~argname ~descr setting adds a new option recognized by the command line of Frama-C. The prefix is unused now. plugin is the shortname of the plug-in. argname is the name of the argument which can be used of the description descr. Both of them are used by the help of the registered option. If descr is None, then the option is not shown in the help.
Since Beryllium-20090601-beta1

Special parameters

Frama-c parameters depending on the command line argument and set at the very beginning of the Frama-C initialisation.

They should not be used directly by a standard plug-in developer.

val debug_level : int
Since Beryllium-20090601-beta1
val verbose_level : int
Since Beryllium-20090601-beta1
val debug_isset : bool
Since Beryllium-20090601-beta1
val verbose_isset : bool
Since Beryllium-20090601-beta1
val kernel_debug_level : int
Since Beryllium-20090901
val kernel_verbose_level : int
Since Beryllium-20090901
val quiet : bool
Since Beryllium-20090601-beta1
val journal_enable : bool
Since Beryllium-20090601-beta1
val journal_name : string
Since Beryllium-20090601-beta1
val use_obj : bool
Since Beryllium-20090601-beta1
val use_type : bool
Since Beryllium-20090601-beta1