Allow command to be a function