aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-06-16 20:14:19 +0000
committerRob Austein <sra@hactrn.net>2008-06-16 20:14:19 +0000
commite625b7a6bad0eb5e151b2714a23cdb8aa791dd65 (patch)
tree2425bf90f91023f3948b6a0e004ef4eb05f560cb /scripts
parent8878e580419c47e3302e3c183be9fa3ca14a234f (diff)
Include some Graphviz diagrams in the documentation.
svn path=/rpkid/Doxyfile; revision=1886
Diffstat (limited to 'scripts')
-rw-r--r--scripts/graphviz-sql.sh30
1 files changed, 13 insertions, 17 deletions
diff --git a/scripts/graphviz-sql.sh b/scripts/graphviz-sql.sh
index 5690bbfc..76901076 100644
--- a/scripts/graphviz-sql.sh
+++ b/scripts/graphviz-sql.sh
@@ -25,20 +25,16 @@
#
# On FreeBSD, SQL Fairy is /usr/ports/databases/p5-SQL-Translator.
-for i in "$@"
-do
- sqlt-graph --db MySQL --output-type canon --show-datatypes --show-constraints $i |
- perl -0777 -pe '
- s/\\\n//g;
- s/ +/ /g;
- s/\\\|/|/g;
- s/\\{([a-z0-9_]+)\|/${1}|{/gi;
- s/-\\ +//g;
- s/\\ \\l/|/g;
- s/\|\\l \\}/}/g;
- s/\|\\}/}/g;
- s/{\n/{\n\tedge [arrowtail=none, arrowhead=crow];\n/;
- ' |
- dot -Tps2 |
- ps2pdf - ${i%.sql}.pdf
-done
+sqlt-graph --db MySQL --output-type canon --show-datatypes --show-constraints $1 |
+SOURCE="$1" perl -0777 -pe '
+ s/\\\n//g;
+ s/ +/ /g;
+ s/\\\|/|/g;
+ s/\\{([a-z0-9_]+)\|/${1}|{/gi;
+ s/-\\ +//g;
+ s/\\ \\l/|/g;
+ s/\|\\l \\}/}/g;
+ s/\|\\}/}/g;
+ s/{\n/{\n\tedge [arrowtail=none, arrowhead=crow];\n/;
+ s=^=// Automatically generated from $ENV{SOURCE}\n\n=;
+'