mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
climc: remove stale zsh completion code
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 "$@"
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user