I would like to know how I would go about creating a command that will see if multiple switches are used in the command, and then perform the command with the switches supplied.

Here's a small command with simple switch use I wrote:

alias test {
if ($1 == -r) {
exit
run $mircexe
}
if ($1 == -d) {
if ($isfile($mircdirtemp.log)) { .remove $shortfn($mircdirtemp.log) }
}
}

Let's say the user used the above command with a combination of switches:

/test -dr


The"test" command, with the switches, would delete the temp.log file, then restart mIRC.

But how can I fix my code so my command will see if more than one switch has been specified, and perform those actions? I don't want to use tons of if statements. I want the code small and clean.


How would I fix this code to see if the the user specified more than one switch, and perform the command using *all* the switches specified? I don't want to use tons of "if" statements.