climc: remove stale zsh completion code

This commit is contained in:
Zexi Li
2020-04-27 21:07:34 +08:00
parent 58d9018092
commit 16adec3a5b
2 changed files with 5 additions and 33 deletions
+5 -3
View File
@@ -128,11 +128,13 @@ func zshCompGenFlagEntryExtras(f structarg.Argument) string {
// allow options for flag
extras := ":"
switch arg := f.(type) {
case *structarg.SingleArgument:
type iChoices interface {
Choices() []string
}
if hasChoices, ok := f.(iChoices); ok {
// process choices
var words []string
for _, w := range arg.Choices() {
for _, w := range hasChoices.Choices() {
words = append(words, fmt.Sprintf("%q", w))
}
if len(words) != 0 {
-30
View File
@@ -75,33 +75,3 @@ _climc(){
do
line="${arr[$i]}"
allopts[count]=${line%s`
const ZSH_COMPLETE_SCRIPT_2 = `%"#"*}
subopts[count]=${line#*"#"}
((count++))
done
_arguments \
'1: :->commands'\
'*: :->options'
case $state in
commands)
_arguments '1:Comm:(${allopts[*]})'
;;
*)
item=1
for key in ${allopts[*]}
do
case $words[2] in
$key)
compadd "$@"` + "`echo $subopts[item]`" + `
;;
*)
;;
esac
((item++))
done
esac
}
_climc "$@"
`