allow commands to specify their own regexes; clean up calling convention