Specify output filename on command line

0 votes
asked May 7, 2023 in Wanted features by anonymous
Could you please consider making it possible to specify the exact output filename on the command line, similar to gcc option -o. This would make it easier to integrate plantuml in a build pipeline.

1 Answer

0 votes
answered May 7, 2023 by The-Lu (89,080 points)

Hello A., and all,

  • What is your use-case?

For example you can use:

cat filename.puml | java -jar plantuml.jar -pipe > anotherfilename.png

See also doc. here:

Regards.

commented May 8, 2023 by Todd Musheno (2,680 points)

I know what he is getting at...

Shell pipes do not work with some build pipelines (it does with a lot of them out there)...

So effectively... how does one get this to work without the "|" and ">" characters.

Or... how do you specify input and output files in the command line.

Also using shell hacks like what you posted is an antipattern in pipelines.

commented Aug 28, 2025 by Martin

How can I process multiple puml files and still specify output filename.

I would need to run planuml in parallel currently with the pipe approach which is not very good in performance.

It would be great to have a option like --keep-filename which does not change the filename of the file to the plantuml title and put it in the same filepath (just with different file-ending). In case there are multiple diagrams in one puml it should fail with this parameter. Eg.:
java -jar plantuml.jar file1 file2 file3 --keep-filename

An alternative would be to specify an output filename for each file. Eg.:
java -jar plantuml.jar file1input.puml file1output.png file2input.puml file2output.png --specify-output-filename

...