Thank you, that looks great. In the present instance it's for a Teensy. Presumably that is saved in the preferences from the previous run of the IDE. So, the command would be like this?
arduino --pref compiler.cpp.extra_flags=-Dsomething myfile.ino
Is there any documentation on the available preference names?
And, is there a way to save it to a hex file instead of uploading it?