doit/cmd_completion.py
def _zsh_arg_line(opt):
        """create a text line for completion of a command arg"""
        # '(-c|--continue)'{-c,--continue}'[continue executing tasks...]' \
        # '--db-file[file used to save successful runs]' \
        if opt.short and opt.long:
            tmpl = ('"(-{0.short}|--{0.long})"{{-{0.short},--{0.long}}}"'
                    '[{help}]" \\')
        elif not opt.short and opt.long:
            tmpl = '"--{0.long}[{help}]" \\'
        elif opt.short and not opt.long:
            tmpl = '"-{0.short}[{help}]" \\'
        else: # without short or long options cant be really used
            return ''
        ohelp = opt.help.replace(']', r'\]').replace('"', r'\"')
        return tmpl.format(opt, help=ohelp).replace('\n', ' ')
create a text line for completion of a command arg
create a text line for completion of a command arg
create a text line for completion of a command arg
def _zsh_arg_line(opt):
        if opt.short and opt.long:
            tmpl = ('"(-{0.short}|--{0.long})"{{-{0.short},--{0.long}}}"'
                    '[{help}]" \\')
        elif not opt.short and opt.long:
            tmpl = '"--{0.long}[{help}]" \\'
        elif opt.short and not opt.long:
            tmpl = '"-{0.short}[{help}]" \\'
        else: 
            return ''
        ohelp = opt.help.replace(']', r'\]').replace('"', r'\"')
        return tmpl.format(opt, help=ohelp).replace('\n', ' ')
def _zsh_arg_line ( opt ) : if opt . short and opt . long : tmpl = ( '"(-{0.short}|--{0.long})"{{-{0.short},--{0.long}}}"' '[{help}]" \\' ) elif not opt . short and opt . long : tmpl = '"--{0.long}[{help}]" \\' elif opt . short and not opt . long : tmpl = '"-{0.short}[{help}]" \\' else : return '' ohelp = opt . help . replace ( ']' , r'\]' ) . replace ( '"' , r'\"' ) return tmpl . format ( opt , help = ohelp ) . replace ( '\n' , ' ' )
create a text line for completion of a command arg
create a text line for completion of a command arg
"""create a text line for completion of a command arg""" # '(-c|--continue)'{-c,--continue}'[continue executing tasks...]' \ # '--db-file[file used to save successful runs]' \ # without short or long options cant be really used
opt