mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	bind filenames var instead of looking up
This commit is contained in:
		@@ -22,8 +22,8 @@ import (
 | 
			
		||||
	"github.com/spf13/cobra"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func AddJsonFilenameFlag(cmd *cobra.Command, usage string) {
 | 
			
		||||
	cmd.Flags().StringSliceP("filename", "f", []string{}, usage)
 | 
			
		||||
func AddJsonFilenameFlag(cmd *cobra.Command, value *[]string, usage string) {
 | 
			
		||||
	cmd.Flags().StringSliceVarP(value, "filename", "f", *value, usage)
 | 
			
		||||
 | 
			
		||||
	annotations := []string{"json", "yaml", "yml"}
 | 
			
		||||
	cmd.Flags().SetAnnotation("filename", cobra.BashCompFilenameExt, annotations)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user