allow for forward passing arguments
This commit is contained in:
parent
f97ace884d
commit
a7a235dfdd
2
Makefile
2
Makefile
@ -55,5 +55,5 @@ clean:
|
||||
-rm ${OUTS}
|
||||
|
||||
test:
|
||||
./allegra depgra debug/dummy_c_project/*.c
|
||||
./allegra depgra -s debug/dummy_c_project/*.c
|
||||
nomacs dependency_graph.png
|
||||
|
9
allegra
9
allegra
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage() {
|
||||
echo "Usage: ${0} [type] <file>"
|
||||
echo "Usage: ${0} [type [options]] <file>"
|
||||
echo " depgra - Generate a dependency graph"
|
||||
echo " flexgra - Generate a scanner graph"
|
||||
}
|
||||
@ -22,16 +22,17 @@ if [[ $# -eq 1 ]]; then
|
||||
FILE="$1"
|
||||
else
|
||||
TYPE="$1"
|
||||
FILE="$2"
|
||||
OPTIONS="${@:2:$(($#-2))}"
|
||||
FILE="${@: -1}"
|
||||
fi
|
||||
|
||||
case "$TYPE" in
|
||||
depgra)
|
||||
depgra "$FILE"
|
||||
depgra $OPTIONS "$FILE"
|
||||
dot -Tpng -o dependency_graph.png c.dot
|
||||
;;
|
||||
flexgra)
|
||||
flexgra "$FILE"
|
||||
flexgra $OPTIONS "$FILE"
|
||||
dot -Tpng -o scanner_graph.png out.dot
|
||||
;;
|
||||
*)
|
||||
|
Loading…
x
Reference in New Issue
Block a user