Here's a shell script that does some stuff according to with what parameter it was called:
if [ $1 = "-add" ]
then
...
elif [ $1 = "-remove" ]
...
else
...
fi
A script is an executable one (a link to it was created in the /usr/bin
directory). So, I can call it from shell by specifying the link name added in /usr/bin
.
What I want, is auto-detecting the possible arguments of script (in my case they are -add
, -remove
) during it calling. It means that when I'll type a command, related to script calling, then type -re
and press a tab button it will suggest that it's -remove
and autofill it for me.
How the arguments need to be defined to reach that?
Tried to create aliases in shell config file or few links in /usr/bin
directory for all possible inputs and it was working fine, but I don't think it's a best solution for that.