
Note that if ($1 !isin -a -rs -ru -l -n) does not properly validate the parameter as passing '-' wouldn't trigger that if.
In this case it's better to use elseif and else to reuse the previous logic, but in general you could have used if (!$istok(-n -a -rs etc..,$1,32))
alias auto.ident {
if ($1 == -a) {
if (($2) && ($3) && ($4)) { writeini $ai.ini $2 $3 $4 }
else { echo -a Please use in the format: /auto.ident -a server nickname password }
}
elseif ($1 == -ru) {
if (($2) && ($3)) { remini $ai.ini $2 $3 }
else { echo -a Please use in the format: /auto.ident -ru server nickname }
}
elseif ($1 == -rs) {
if (($2)) { remini $ai.ini $2 }
else { echo -a Please use in the format: /auto.ident -rs server }
}
elseif ($1 == -l) {
window -adl20k0S @auto-ident
titlebar @auto-ident $ai.ini
filter -fLg $ai.ini @auto-ident /^\[[^\[\]]++\]$/
}
elseif ($1 == -n) {
$iif($readini($ai.ini,options,nick) == enable,writeini $ai.ini options nick disable,writeini $ai.ini options nick enable)
}
else {
echo -a Please use in the form auto.ident [-a/-ru/-rs/-l]
echo -a -a = Add auto ident. Eg: /auto.ident -a server.com mynick password
echo -a -ru = Remove auto ident nickname. Eg: /auto.ident -ru server.com nickname
echo -a -rs = Remove auto ident server. Eg: /auto.ident -rs server.com
echo -a -l = List currently stored servers and Passwords. Used as: /audio.ident -l
echo -a -n = This will disable the auto nickname change when connecting to a server with a stored auto-identification. Used as: /auto.ident -n
echo -a You can use -n again to Re-enable the auto nickname change.
}
}