what_to_execute decides what to execute version must == 0 or == 1.
When it is executed it returns a number that is determined by comparing arg to command_nicknames (capital insensitive) and if arg is in command_nicknames it returns Some(i) where i is the index of arg in command_nicknames.
Else if all_is_255 && arg == "all" than Some(255) is returned
Else if arg is a decimal integer it returns arg as a integer
Else it returns None if version == 0 or Some(245) if version == 1
I recommend you read the code. version being equal to 1 is deprecated (see #1).
I reccommend setting constants for each of the command nicknames to make the code more readable