#!/bin/bash
#
# tree2dotx --- transfer a "tree"(such as the result of tree,calltree,cflow -b)
# to a picture discribed by DOT language(provided by Graphviz)
#
# Author: falcon <wuzhangjin@gmail.com>
# Update: 2007-11-14, 2015-3-19
# Usage:
#
# tree -L 2 -d /path/to/a/directory | bash tree2dotx | dot -Tsvg -o tree.svg
# cd /path/to/a/c/project/; calltree -gb -np -m *.c | bash tree2dotx | dot -Tsvg -o calltree.svg
# cd /path/to/a/c/project/; cflow -b -m setup_rw_floppy kernel/blk_drv/floppy.c | bash tree2dotx | dot -Tsvg -o cflow.svg
#
# Set the picture size, direction(LR=Left2Right,TB=Top2Bottom) and shape(diamond, circle, box)
size="1920,1080"
direction="LR"
shape="box"
# color, X11 color name: http://en.wikipedia.org/wiki/X11_color_names
fontcolor="blue"
fillcolor="Wheat"
# fontsize
fontsize=16
# Specify the symbols you not concern with space as decollator here
filterstr="";
# output: dot, flame
output="dot"
# Usage
function usage
{
echo ""
echo " $0 "
echo ""
echo " [ -f \"filter1 filter2 ...\" ]"
echo " [ -s size, ex: 1080,760; 1920,1080 ]"
echo " [ -d direction, ex: LR; TB ]"
echo "
tree2dotx
最新推荐文章于 2024-04-17 02:22:56 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)