@codebrainz might be thinking of [templates commands](https://www.geany.org/manual/current/index.html#special-command-wildcard) where set environment variables and set, but custom commands do not seem to do so.
I tend to prefer the command arguments approach over the environment variables since no existing command will understand the `GEANY_XXX` variables so their use is restricted to shell scripts or user written commands, but there is a chance that and existing command might understand something like the filetype passed as an argument the way @GFdevelop showed. But a `%` letter should be chosen to not overlap with the build command replacements, so `%e` is taken. Perhaps `%t` for fileType.