WireViz icon indicating copy to clipboard operation
WireViz copied to clipboard

Strategy on overriding certain options, storing default options

Open 17o2 opened this issue 4 years ago • 1 comments

#214 has added the possibility of configuring certain options (colors, fonts, BOM formatting, language for color display names, ...) in the YAML, as originally proposed in #158.

The following functionalities would be highly desirable:

  • To be able to define "global" defaults, to avoid defining them in every individual harness YAML file.
  • To be able to override options from the command line for one-off use (e.g. quickly export a version with German color names on the fly, without touching the YAML)

A hierarchy of prioritization of the different configuration sources should be defined, for predictable outputs. Proposal:

  1. Setting options via command line parameters (not likely to be required often, but should have # 1 priority)
  2. Setting options in the harness YAML file
  3. Setting options in the prepended YAML file (likely to be used for user- / company-wide defaults to use in all harnesses)
  4. Setting options in the WireViz config file* (currently not implemented).

*Some ideas on the config file:

  • Could be a YAML-formatted file, perhaps named .wvconfig or similar, and stored in a user's home folder
  • If it exists, it should set the default options to use whenever running wireviz
  • Could be used to specify a default prepend file, to avoid the need for specifying it in the CLI every time
  • Could be expanded over time to cover many more config options
    • Which columns to display in the BOM table, in what order, which language to use for column headers, ...
    • ...

17o2 avatar Aug 25 '21 18:08 17o2

I also suggest a CLI option to ignore any global options. This is useful when wanting an output that only depends on the imput YAML file, e.g. when running build_examples.py for comparison purposes.

kvid avatar Aug 29 '21 22:08 kvid