Configuring output

Choosing an output file

You can set an output file using the -o flag. If this argument is not provided, the results will be either printed on the standard output if possible, or saved in a default file (for images).

Example:

unidep src -o my-output-file

Output formats

Unidep supports three types of output format: images, DOT files or JSON files.

You can select one of this format using the --output-format flag:

  • image (default)
  • dot (Graphviz DOT format)
  • json

Users who want a ready-to-use results will prefer image (the default format), the ones who want to render the graph in a custom way might prefer dot and users who want to reuse the output in another external program may prefer json.

Images and DOT files

For image, the format of the image is inferred from the output file extension. If no output file is provided, a default png file will be created, but it is recommended to provide an output file. Supported extensions:

  • png
  • svg.

For dot however, if no output file is provided, the output will be printed to standard output.

Examples:

unidep src # will save output to unidep-output.png
unidep src -o output.svg
unidep src --output-format dot # will print the DOT file to stdout

Custom display configuration

If you are aiming at produce nice graphs, you can specify a configuration file describing which display styles should be used to render different nodes. TODO support --display-config with a path to a config file

JSON

JSON output is not targeted at display, but rather for use by an external program. Thus, it doesn't support custom display configuration.

If no output file is provided, the resulting JSON file will be printed to stdout.

Example:

unidep src --output-format json # will print the JSON file to stdout

Example output:

TODO