Expose `--graph`/`--node`/`--edge` CLI options on `dependencies` command for injecting GraphViz attributes
I've thought about exposing more graphviz settings (i.e. shape, splines, …) as CLI options but ended up not doing it as one would quickly accumulate a massive amount of options (each with their own reasonable rational on why it should be included), while making it hard to see the forest for the trees, when reading --help. That said I too would like to be able to inject configurations into the generated .dot files without having to manually edit the output afterwards.
Maybe having generalized CLI options for the dependencies command for graph/node/edge default attributes that accept a comma-separated list of key-value pairs would be an acceptable compromise though:
--graph "rankdir='LR', …"--node "shape='box', …"--edge "weight=2, …"
I agree, reproducing these settings in cargo-modules is not needed.
They can be passed on when you generate the dot file. For example:
cargo-modules dependencies -p rc-bot --no-externs --no-types --no-traits --no-fns | dot -Gsplines=curved -Tsvg -omodules.svg
Maybe a link to the command line help in your readme would prevent people from asking for these kind of features :-). https://graphviz.org/doc/info/command.html
I agree, reproducing these settings in cargo-modules is not needed.
One argument for at least providing generalized --graph/--node/--edge CLI options that I'd see is that you might want to save the .dot file rather than its rendered view, or you might be using a visualizer, such as a VSCode extension, which doesn't allow for passing arguments to dot. But yeah, the cargo modules dependencies … | dot -G… approach should probably be mentioned in the README somewhere for sure!