mirror of
https://github.com/containers/podman.git
synced 2026-03-19 07:08:38 -04:00
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.22.0 to 0.23.0. - [Release notes](https://github.com/containers/common/releases) - [Commits](https://github.com/containers/common/compare/v0.22.0...v0.23.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
27 lines
1.1 KiB
Go
27 lines
1.1 KiB
Go
package completion
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
// FlagCompletions - hold flag completion functions to be applied later with CompleteCommandFlags()
|
|
type FlagCompletions map[string]func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
|
|
|
|
// CompleteCommandFlags - Add completion functions for each flagname in FlagCompletions.
|
|
func CompleteCommandFlags(cmd *cobra.Command, flags FlagCompletions) {
|
|
for flagName, completionFunc := range flags {
|
|
_ = cmd.RegisterFlagCompletionFunc(flagName, completionFunc)
|
|
}
|
|
}
|
|
|
|
/* Autocomplete Functions for cobra ValidArgsFunction */
|
|
|
|
// AutocompleteNone - Block the default shell completion (no paths)
|
|
func AutocompleteNone(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
|
return nil, cobra.ShellCompDirectiveNoFileComp
|
|
}
|
|
|
|
// AutocompleteDefault - Use the default shell completion,
|
|
// allows path completion.
|
|
func AutocompleteDefault(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
|
return nil, cobra.ShellCompDirectiveDefault
|
|
}
|