(self, command, depth)
| 94 | self.writeln("complete -F _stoke stoke") |
| 95 | |
| 96 | def write_cmd(self, command, depth): |
| 97 | comps = [] |
| 98 | if command.has_subcommands(): |
| 99 | for sub in command.subcommands: |
| 100 | comps.append(sub.name) |
| 101 | else: |
| 102 | for arg in command.arguments: |
| 103 | for param in arg.params: |
| 104 | comps.append(param) |
| 105 | |
| 106 | self.writeln(" if [ $COMP_CWORD -eq " + str(depth) + " -a $prev == " + command.name + " ]") |
| 107 | self.writeln(" then") |
| 108 | self.writeln(" COMPREPLY=( $(compgen -W \"" + " ".join(comps) + "\" -- $cur) )") |
| 109 | self.writeln(" fi") |
| 110 | |
| 111 | def finish(self): |
| 112 | super(BashHandler, self).finish() |
no test coverage detected