2022-03-30 09:27:25 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/cli/cli/context/store"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2024-07-05 08:57:19 -04:00
|
|
|
type contextStoreProvider interface {
|
|
|
|
ContextStore() store.Store
|
|
|
|
}
|
|
|
|
|
2024-10-18 05:20:38 -04:00
|
|
|
func completeContextNames(dockerCLI contextStoreProvider) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
|
|
|
return func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
2024-07-05 08:57:19 -04:00
|
|
|
names, _ := store.Names(dockerCLI.ContextStore())
|
|
|
|
return names, cobra.ShellCompDirectiveNoFileComp
|
2024-01-11 12:17:47 -05:00
|
|
|
}
|
2024-10-18 05:20:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
var logLevels = []string{"debug", "info", "warn", "error", "fatal", "panic"}
|
2024-01-11 12:17:47 -05:00
|
|
|
|
2024-10-18 05:20:38 -04:00
|
|
|
func completeLogLevels(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
|
|
|
|
return cobra.FixedCompletions(logLevels, cobra.ShellCompDirectiveNoFileComp)(nil, nil, "")
|
2022-03-30 09:27:25 -04:00
|
|
|
}
|