def _zsh_comp_command(self, zcf, cmd, grouping, add_help=True):
if add_help:<EOL><INDENT>if grouping:<EOL><INDENT>print("<STR_LIT>", end=BLK, file=zcf)<EOL><DEDENT>print("<STR_LIT>", end=BLK, file=zcf)<EOL>print("<STR_LIT>", end=BLK, file=zcf)<EOL><DEDENT>no_comp = ('<STR_LIT:store_true>', '<STR_LIT>')<EOL>cmd_dict = self._opt_cmds[cmd] if cmd else self._opt_bare<EOL>for opt, sct in cmd_dict.items():<EOL><INDENT>meta = self._conf[sct].def_[opt]<EOL>if meta.cmd_kwargs.get('<STR_LIT:action>') == '<STR_LIT>':<EOL><INDENT>grpfmt, optfmt = "<STR_LIT>", "<STR_LIT>"<EOL>if meta.comprule is None:<EOL><INDENT>meta.comprule = '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>grpfmt, optfmt = "<STR_LIT>", "<STR_LIT>"<EOL><DEDENT>if meta.cmd_kwargs.get('<STR_LIT:action>') in no_compor meta.cmd_kwargs.get('<STR_LIT>') == <NUM_LIT:0>:<EOL><INDENT>meta.comprule = None<EOL><DEDENT>if meta.comprule is None:<EOL><INDENT>compstr = '<STR_LIT>'<EOL><DEDENT>elif meta.comprule == '<STR_LIT>':<EOL><INDENT>optfmt = optfmt.split('<STR_LIT:[>')<EOL>optfmt = optfmt[<NUM_LIT:0>] + '<STR_LIT>' + optfmt[<NUM_LIT:1>]<EOL>compstr = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>optfmt = optfmt.split('<STR_LIT:[>')<EOL>optfmt = optfmt[<NUM_LIT:0>] + '<STR_LIT>' + optfmt[<NUM_LIT:1>]<EOL>compstr = '<STR_LIT>'.format(meta.comprule)<EOL><DEDENT>if grouping:<EOL><INDENT>print(grpfmt.format(opt), end=BLK, file=zcf)<EOL><DEDENT>for name in _names(self._conf[sct], opt):<EOL><INDENT>print(optfmt.format(name, meta.help.replace("<STR_LIT:'>", "<STR_LIT>"),<EOL>compstr), end=BLK, file=zcf)<EOL><DEDENT><DEDENT>
Write zsh _arguments compdef for a given command.

        Args:
            zcf (file): zsh compdef file.
            cmd (str): command name, set to None or '' for bare command.
            grouping (bool): group options (zsh>=5.4).
            add_help (bool): add an help option.