Option for no error when no diagrams are found

0 votes
asked Mar 31, 2021 in Wanted features by Kristian
Hello,

when using plantuml with the downloaded jar using the cli, it would be useful to have an option which let the command not returning an error even if no diagrams are found.

I'm using plantuml for automatically generating some diagrams for some markdown files (which include the next to be generated svg) inside a nodejs repo and I'm using some npm script for generating documentation (markdown to pdf). The problem is, even if I don't have plantuml files to generate diagrams from, I would like to run my "npm run docs" and have my pdf files ready. The command now generate the diagrams using plantuml.jar via cli and then convert all markdown files to pdf, but since plantuml exit with an error code if it doesn't find any diagrams, the whole command fails.

1 Answer

0 votes
answered Mar 31, 2021 by plantuml (295,000 points)
We already have too many option flags :-)

However, maybe it's a better option to NOT exit with an error code when there is no diagram.

So we change last beta http://beta.plantuml.net/plantuml.jar to this new way.

Tell us if it's working for you.

If other people complain about this slight change, we will add yet another flag.
commented Mar 31, 2021 by Kristian
That's great!

So the next versions are not exiting with an error if no diagrams has been found. Any date for the next release?

I have tried locally the beta release of plantuml you gave me here, but I would rather not use it on my work environment since it's still a beta. Are there also https download links?

Thanks in advance!
Kristian
commented Apr 24, 2021 by kirchsth (4,960 points)
Hi Kristian, why are no calling a shell/batch command which calls the conversion command itself and the shell command ignores the return value of the conversion and returns 0 every time?

BR Helmut
commented Apr 26, 2021 by Kristian

Hi Helmut, basically for 2 reasons!

  1. I think it should be something strictly related to the tool. Since erroring when no diagrams are found by default is a strongly opinionated position for a tool like this one (in my opinion) there should be a clear way to change this behavior. Don’t know philosophically which option should be the default one, but I think it should be provided by the tool directly
  2. I am not a shell/batch expert but I think what you described would be achieved by some conversion command I don’t know of but I guess it would make it less clear what the command does when a third person join the project I’m working on or by putting everything in a shell/batch file and executing it which would require maintain another file in the project which is an option I’m not a big fan of

If there’s an easy and clear way to achieve what you described, please tell me about it!

...