cmdcheck: support --log=<FILE>, --log-level=<NUMBER> and --print-directory