Skip to content

Commit

Permalink
Fills can now take multiple arguments and changed the declaration for…
Browse files Browse the repository at this point in the history
… each cmdType in add()
  • Loading branch information
Dosx001 committed Jan 5, 2021
1 parent 1b4d3e7 commit 527aea5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions aliasme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ _add() {
read -ep "Input cmd to add:" cmd
fi

if [ "$3" == "D" ];then
if [ "$3" == "d" ];then
cmdType="Dynamic"
elif [ "$3" == "F" ]; then
elif [ "$3" == "f" ]; then
cmdType="Fill"
elif [ "$3" == "MF" ]; then
elif [ "$3" == "m" ]; then
cmdType="Multi Fill $4"
else
cmdType="Default"
Expand Down Expand Up @@ -76,15 +76,20 @@ _excute() {
read -u9 cmdType
if [ "$cmdType" == "Default" ]; then
eval $line
elif [ "$cmdType" == "Fill" ]; then
eval "${line//\?/$2}"
elif [ "$cmdType" == "Dynamic" ]; then
cmds=()
for i in $(seq 2 $#); do
eval arg=\$$i
cmds+=$arg\
done
eval $line $cmds
elif [ "$cmdType" == "Fill" ]; then
cmds=()
for i in $(seq 2 $#); do
eval arg=\$$i
cmds+=$arg\
done
eval "${line//\?/$cmds}"
else
fills=(${cmdType// / })
for i in $(seq 1 ${fills[2]}); do
Expand Down

0 comments on commit 527aea5

Please sign in to comment.