Just noticed it uses `$0` instead, which always gives the full script path, not the name of the command actually used.