Use pipes.

This commit is contained in:
Diomidis Spinellis 2007-05-27 20:17:55 +00:00
parent 96ce9aac63
commit 0a3d86a0d0
2 changed files with 28 additions and 4 deletions

20
umlgraph Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# Unix shell script to run UMLGraph on the specified base file name
# For this to work the JDK tools.jar file must be located in the
# same directory as UmlGraph.jar. You also need to adjust the path
# of UmlGraph.jar to the actual path where the jar file is installed.
#
# $Id$
#
if [ x$2 = x ]
then
echo usage: umlgraph base_file_name filetype [umlgraph arguments] 1>&2
echo example: umlgraph MyClass png 1>&2
echo '(The above will convert MyClass.java into MyClass.png)' 1>&2
exit 1
else
java -jar lib/UmlGraph.jar -package $* -output - $1.java |
dot -T$2 -o$1.$2
fi

View File

@ -1,15 +1,19 @@
@echo off
rem Run UMLGraph on the specified base file name
rem Windows batch file to run UMLGraph on the specified base file name
rem For this to work the JDK tools.jar file must be located in the
rem same directory as UmlGraph.jar. You also need to adjust the path
rem of UmlGraph.jar to the actual path where the jar file is installed.
rem $Id$
if not "%2" == "" goto ok
echo usage: umlgraph base_file_name filetype [umlgraph arguments]
echo usage: umlgraph base_file_name filetype [umlgraph arguments] 1>&2
echo example: umlgraph MyClass png 1>&2
echo (The above will convert MyClass.java into MyClass.png) 1>&2
goto end
:ok
javadoc -docletpath lib/UmlGraph.jar -package -doclet gr.spinellis.umlgraph.doclet.UmlGraph %3 %4 %5 %6 %7 %8 %9 -output %1.dot %1.java
dot -T%2 -o%1.%2 %1.dot
java -jar lib/UmlGraph.jar -package %3 %4 %5 %6 %7 %8 %9 -output - %1.java | dot -T%2 -o%1.%2
:end