mirror of
https://github.com/containers/skopeo.git
synced 2025-09-04 08:04:56 +00:00
Bump github.com/containers/common from 0.22.0 to 0.23.0
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>
This commit is contained in:
committed by
Daniel J Walsh
parent
8151b89b81
commit
1c45df1e03
18
vendor/github.com/containers/common/pkg/auth/cli.go
generated
vendored
18
vendor/github.com/containers/common/pkg/auth/cli.go
generated
vendored
@@ -3,6 +3,7 @@ package auth
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/containers/common/pkg/completion"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
@@ -49,6 +50,16 @@ func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet {
|
||||
return &fs
|
||||
}
|
||||
|
||||
// GetLoginFlagsCompletions returns the FlagCompletions for the login flags
|
||||
func GetLoginFlagsCompletions() completion.FlagCompletions {
|
||||
flagCompletion := completion.FlagCompletions{}
|
||||
flagCompletion["authfile"] = completion.AutocompleteDefault
|
||||
flagCompletion["cert-dir"] = completion.AutocompleteDefault
|
||||
flagCompletion["password"] = completion.AutocompleteNone
|
||||
flagCompletion["username"] = completion.AutocompleteNone
|
||||
return flagCompletion
|
||||
}
|
||||
|
||||
// GetLogoutFlags defines and returns logout flags for containers tools
|
||||
func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet {
|
||||
fs := pflag.FlagSet{}
|
||||
@@ -56,3 +67,10 @@ func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet {
|
||||
fs.BoolVarP(&flags.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file")
|
||||
return &fs
|
||||
}
|
||||
|
||||
// GetLogoutFlagsCompletions returns the FlagCompletions for the logout flags
|
||||
func GetLogoutFlagsCompletions() completion.FlagCompletions {
|
||||
flagCompletion := completion.FlagCompletions{}
|
||||
flagCompletion["authfile"] = completion.AutocompleteDefault
|
||||
return flagCompletion
|
||||
}
|
||||
|
26
vendor/github.com/containers/common/pkg/completion/completion.go
generated
vendored
Normal file
26
vendor/github.com/containers/common/pkg/completion/completion.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user