Strip spaces from custom commands

The unstripped version is used in error messages.