CLI: allow "-d basedir" before the command, as well as after

This enables an alias like p1="petmail -d basedir1" and then
easy-to-type commands like "p1 fetch-messages"