From: Sergey Matveev Date: Tue, 6 May 2025 13:01:32 +0000 (+0300) Subject: dot X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a9db5086167e909fb8411789c3bce0684c99fa49;p=zk.git dot --- diff --git a/zk b/zk index 5f1fe40..8b2a8d7 100755 --- a/zk +++ b/zk @@ -97,7 +97,9 @@ sub usage { print STDERR "Usage: \t$0 links PAGE \t$0 backs PAGE -\t$0 htmls DIR\n"; +\t$0 htmls DIR +\t$0 dot | dot -Tpng >png +"; exit 1; } @@ -302,6 +304,14 @@ if ($ARGV[0] eq "dump") { @s = stat($pth) or die "$!"; utime $s[9], $s[9], "$ARGV[1]/$pth.html"; } +} elsif ($ARGV[0] eq "dot") { + print "digraph d {\n"; + while (my ($from, $v) = each %links) { + foreach (@{$v}) { + print "\t\"$from\" -> \"$_\"\n"; + } + } + print "}\n"; } else { usage; }