allow for forward passing arguments

This commit is contained in:
anon 2025-01-12 22:04:27 +01:00
parent f97ace884d
commit a7a235dfdd
2 changed files with 6 additions and 5 deletions

@ -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

@ -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
;;
*)