Utilisation
Description

The oug tool is launched the following way (oug is the native code version, while oug.byte is the bytecode version):

oug [options] <.ml{i} files>

The .ml and .mli files do not need to be sorted by dependency order any more, as it was required in versions 1.x of Oug.

The .mli files are used to add "Export" edges between a module (or class) and the elements it contains, so that they don't appear as "unused" in the "useless" dump. This is useful when using Oug on libraries since provided elements are not always internally used by the library.

Various options are available: General options, compilation options needed by the OCaml compiler called from the Oug analyzer, and options to specify actions.

General options

These options concern the general behaviour of Oug:

  • -v: Increse verbosity level by one; can be specified several times.
  • -o <file>: Set the name of the output file, instead of "dump.oug".
  • --no-reduce: By default, Oug reduce graphs to remove expression nodes, except idents. This option tells Oug to keep all nodes.
  • --load <file>: Load a global graph from the given file,
  • -c: This option prevents Oug from gathering all the module graphs into a final graph; instead, it just creates .ouf and .oufi files containing the module graph for each .ml and .mli file passed on the command line.
Compilation options

These options are the same as some of the ocamlc compiler:

  • -I <dir>: Add <dir> to the list of include directories.
  • -nolabels: Ignore non-optional labels in types.
  • -pp <command>: Pipe sources through preprocessor <command>.
  • -rectypes: Allow arbitrary recursive types.
Action options

The other options can be used to perform actions on the graph. All actions are executed in the order they appear on the command line.

Some actions create graph dump in various formats or extract information from the graph, while other can be used to incrementally fill the global graph, or reload modules, ...

Some options trigger analysis actions, like --useless-elements and other options are used to give additional information for some actions, like the --progress option.

See here for a complete list of availables options.