Support hook invocation from 'append_cmd'.