Shell 提前完成tcsh。利用旧的决定进一步影响

Shell 提前完成tcsh。利用旧的决定进一步影响,shell,tcsh,tab-completion,Shell,Tcsh,Tab Completion,我想做一些完整的使用,比如: my_setup -project 点击选项卡时,它将显示项目选项: proj1 proj2 proj3 选择proj1后 my_setup -project proj1 -step 当点击选项卡时,它将显示所选项目中的步骤选项 steps options for proj1: step0 step1.3 step9.0 steps options for proj2: step0.0 steps options for proj3: st

我想做一些完整的使用,比如:

my_setup -project 
点击选项卡时,它将显示项目选项:

proj1 proj2 proj3
选择proj1后

my_setup -project proj1 -step
当点击选项卡时,它将显示所选项目中的步骤选项

steps options for proj1:    step0 step1.3 step9.0
steps options for proj2:    step0.0
steps options for proj3:    step55
我首先说:

complete my_setup "c/-/(project step)/" \
    'n/-help/n/' \
    'n/-project/`echo $PROJ_OPT`/ ' \
    'p/1/x:<Exampleof use>/ '
完成我的设置“c/-/(项目步骤)/”\
'n/-help/n/'\
'n/-project/'echo$PROJ_OPT`/'\
“p/1/x:/”
它显示了我的项目选项,但我不知道如何让我知道用户选择项目后的步骤


谢谢您的帮助。

我不知道您是否可以定义这样的上下文感知完成规则,但您是否可以将项目和步骤选项合并为一个选项? 我以前使用过这种方法

这可能看起来像:

% my_setup -project-step <TAB>
proj1:step0 proj1:step1.3 proj1:step9.0 proj2:step0.0 proj3:step55
complete my_setup "c/-/(project step)/" \
    'n/-help/n/' \
    'n/-project-step/`echo $PROJ_STEP_OPT`/ '