Skip to content

Commit

Permalink
All Fills and Milti Fills are now just Fills. While the new Multi Fil…
Browse files Browse the repository at this point in the history
…l is now is a combination of Fill and Dynamic
  • Loading branch information
Dosx001 committed Jan 4, 2021
1 parent 7f46643 commit 4e4df8b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions aliasme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _add() {
elif [ "$3" == "F" ]; then
cmdType="Fill"
elif [ "$3" == "MF" ]; then
cmdType="Multi Fill"
cmdType="Multi Fill $4"
else
cmdType="Default"
fi
Expand Down Expand Up @@ -74,9 +74,9 @@ _excute() {
if [ "$1" = "$line" ]; then
read -u9 line
read -u9 cmdType
if [ "$cmdType" == "Fill" ]; then
eval "${line/\?/$2}"
elif [ "$cmdType" == "Multi Fill" ]; then
if [ "$cmdType" == "Default" ]; then
eval $line
elif [ "$cmdType" == "Fill" ]; then
eval "${line//\?/$2}"
elif [ "$cmdType" == "Dynamic" ]; then
cmds=()
Expand All @@ -86,6 +86,12 @@ _excute() {
done
eval $line $cmds
else
fills=(${cmdType// / })
for i in $(seq 1 ${fills[2]}); do
let num=$i+1
eval arg=\$$num
line=${line//\?$i/$arg}
done
eval $line
fi
return 0
Expand Down Expand Up @@ -140,7 +146,7 @@ al(){
if [ $1 = "ls" ]; then
_list
elif [ $1 = "add" ]; then
_add $2 "$3" $4
_add $2 "$3" $4 $5
elif [ $1 = "rm" ]; then
_remove $2
elif [ $1 = "-h" ]; then
Expand Down

0 comments on commit 4e4df8b

Please sign in to comment.