shell_completion.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:globus-cli 作者: globus 项目源码 文件源码
def do_bash_complete():
    comp_words, quoted = safe_split_line(os.environ['COMP_WORDS'])
    cur_index = int(os.environ['COMP_CWORD'])
    try:
        cur = comp_words[cur_index]
        completed_args = comp_words[1:-1]
    except IndexError:
        cur = None
        completed_args = comp_words[1:]

    choices = get_all_choices(completed_args, cur, quoted)

    safeprint('\t'.join(choices), newline=False)
    click.get_current_context().exit(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号