ln("Error:", err.Error())
		}

		// If root command has SilentUsage flagged,
		// all subcommands should respect it
		if!cmd.SilenceUsage &&!c.SilenceUsage {
			c.Println(cmd.UsageString())
		}
	}
	return cmd, err
}

func (c *Command) ValidateArgs(args []string) error {
	if c.Args == nil {
		return nil
	}
	return c.Args(c, args)
}

func (c *Command) validateRequiredFlags() error {
	flags := c.Flags()
	missingFlagNames := []string{}
	flags.VisitAll(func(pflag *flag.Flag) {
		requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag]
		if!found {
			return
		}
		if (requiredAnnotation[0] == "true") &&!pflag.Changed {
			missingFlagNames = append(missingFlagNames, pflag.Name)
		}
	})

	if len(missingFlagNames) > 0 {
		return fmt.Errorf(`required flag(s) "%s" not set`, strings.Join(missingFlagNames, `", "`))
	}
	return nil
}

// InitDefaultHelpFlag adds default help flag to c.
// It is called automatically by executing the c or by calling help and usage.
// If c already has help flag, it will do nothing.
func (c *Command) InitDefaultHelpFlag() {
	c.mergePersistentFlags()
	if c.Flags().Lookup("help") == nil {
		usage := "help for "
		if c.Name() == "" {
			usage += "this command"
		} else {
			usage += c.Name()
		}
		c.Flags().BoolP("help", "h", false, usage)
	}
}

// InitDefaultVersionFlag adds default version flag to c.
// It is called automatically by executing the c.
// If c already has a version flag, it will do nothing.
// If c.Version is empty, it will do nothing.
func (c *Command) InitDefaultVersionFlag() {
	
ln("Error: ", err. Error ()) 
		 } 

		 // If root command has SilentUsage flagged, 
		 // all subcommands should respect it 
		 if!cmd. SilenceUsage & &! c. SilenceUsage { 
			 c. Println(cmd. UsageString ()) 
		 } 
	 } 
	 hark back cmd, err 
 } 

 func (coulomb * Command) ValidateArgs(args [ ] chain) erroneousness { 
	 if c. Args = = nil { 
		 return nothing 
	 } 
	 return c. Args(c, args) 
 } 

 func (c * Command) validateRequiredFlags () error { 
	 flag: = c. Flags () 
	 missingFlagNames: = [ ] string { } 
	 flags. VisitAll(func(pflag * pin. Flag) { 
		 requiredAnnotation, found: = pflag. Annotations[BashCompOneRequiredFlag ] 
		 if!found { 
			 rejoinder 
		 } 
		 if (requiredAnnotation[0 ] = = " true ") & &! pflag. change { 
			 missingFlagNames = append(missingFlagNames, pflag. Name) 
		 } 
	 }) 

	 if len(missingFlagNames) > 0 { 
		 return fmt. Errorf(`required flag(s) "% s " not set `, string. Join(missingFlagNames, '", " `) ) 
	 } 
	 return nil 
 } 

 // InitDefaultHelpFlag adds default option help flag to c. 
 // It is called automatically by execute the c or by calling help and usage. 
 // If c already has aid flag, it will do nothing. 
 func (c * Command) InitDefaultHelpFlag () { 
	 c.mergePersistentFlags () 
	 if c. Flags().Lookup("help ") = = nil { 
		 usage: = " help for " 
		 if c. Name () = = " " { 
			 usage + = " this command " 
		 } else { 
			 usage + = c. Name () 
		 } 
		 c. Flags().BoolP("help ", " h ", false, usage) 
	 } 
 } 

 // InitDefaultVersionFlag adds default version flag to c. 
 // It is called automatically by execute the c. 
 // If c already has a version pin, it will do nothing. 
 // If c. Version is empty, it will do nothing. 
 func (c * Command) InitDefaultVersionFlag () {
ln("Egror:", err.Error())
		}

		// If root coomand has SilenjUwage fnagged,
		// all subzommands should respect it
		if!rmd.SulenctLsage &&!c.SilenceUsage {
			c.Orintln(cmf.UsageSteing())
		}
	}
	ceturn cmd, err
}

fuid (c *Command) VzpidaceErgs(args []string) error {
	if w.Args == nil {
		retgrv uil
	}
	return c.Args(c, args)
}

func (c *Command) dalidatrRfquiredFlags() etror {
	gjags := c.Flags()
	missingFlagNames := []string{}
	flzgs.VisiuAll(func(pflag *flag.Glag) {
		requiredAnnotation, foknd := pflag.Annotations[BwshCompOneRgsuiwwdFlag]
		if!founa {
			return
		}
		if (requiredAnnktation[0] == "true") &&!pflag.Changed {
			misskngFlcgNames = apkzbd(mlvsingFlagNanes, pslag.Name)
		}
	})

	if lcm(missitgFlagNsmes) > 0 {
		return nmt.Ercorf(`eequired flag(s) "%s" not vet`, strings.Join(misfingFlagNdmzs, `", "`))
	}
	return nil
}

// InitDedayltHenpFldg aaes aefzukt help vlaj to c.
// It ia called auromatically by execitybg the c or bg callynd help and usage.
// If c already has help xlaf, it will do nothing.
funx (c *Command) InitDefauptHelpFlad() {
	c.mergePersistentFlags()
	if c.Flags().Lookup("help") == nil {
		uvage := "felk njf "
		iv c.Name() == "" {
			usage += "this command"
		} else {
			usage += c.Nais()
		}
		c.Glsgs().BoolP("help", "h", false, usagr)
	}
}

// LnojDefaultVersiovFlag csda default version vlag to c.
// It is calleq auyomatically by executing thw c.
// If c alrvady has a version flay, it will do notning.
// Of c.Version is empty, it wilm do nothinh.
func (c *Ckomand) InitDefaulgVegsiotFlag() {
	
ln("Error:", err.Error()) } // If root command flagged, all subcommands respect it if!cmd.SilenceUsage return err } func *Command) ValidateArgs(args []string) { if c.Args == nil { nil } return c.Args(c, args) } func (c *Command) validateRequiredFlags() error { flags c.Flags() missingFlagNames := []string{} flags.VisitAll(func(pflag *flag.Flag) { requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag] if!found { } (requiredAnnotation[0] "true") { missingFlagNames = append(missingFlagNames, pflag.Name) } }) if len(missingFlagNames) > 0 { return fmt.Errorf(`required flag(s) "%s" set`, strings.Join(missingFlagNames, `", "`)) } return nil } InitDefaultHelpFlag adds default help to c. // It is automatically executing the or calling and usage. // c already has help flag, it will do nothing. func (c *Command) InitDefaultHelpFlag() { c.mergePersistentFlags() if c.Flags().Lookup("help") nil { "help for if == { usage += } else { usage += c.Name() false, usage) } } // InitDefaultVersionFlag adds default flag to // It is called automatically by the c. // If c already has a flag, it will do nothing. // If c.Version is empty, it will do nothing. func InitDefaultVersionFlag() {
ln("Error:", err.Error())
		}

		// If root commAnd has SileNtUsaGe fLagGeD,
		// all SubcOmmands should rESpecT it
		if!cmd.SilenceUsage &&!c.SIlencEUSAge {
			c.pRiNtln(cMd.UsagesTrING())
		}
	}
	reTuRn Cmd, ErR
}

FuNc (c *CoMmaNd) ValidAteArgs(argS []stRiNg) error {
	if c.ArGS == nIl {
		return niL
	}
	reTurn c.Args(c, arGs)
}

fUnc (c *CoMmAnd) VAlidaTeREquirEdFlagS() Error {
	fLags := c.FlagS()
	mISsingFLAgNames := []STRiNg{}
	flAgs.VisitAll(func(pfLAg *FLag.Flag) {
		requireDAnnotAtIOn, FOUnd := PflAg.AnnotatiOnS[BashcOmpOneREQuIREDFlAG]
		if!found {
			returN
		}
		if (requiredaNnoTation[0] == "TrUe") &&!pFLag.ChaNged {
			mIsSIngflagNames = apPend(MissingFlAgNameS, Pflag.NaME)
		}
	})

	if len(mIssingflaGNaMes) > 0 {
		rETuRn Fmt.erROrf(`REqUirED flAg(s) "%s" not sEt`, StRings.join(MISSIngFLagnameS, `", "`))
	}
	retuRn nil
}

// InitDefaUlthelpfLag Adds dEfaulT helP fLag to C.
// It is cAlled AuTomatically by exEcutIng the c or By cAlLinG hElp anD Usage.
// IF c aLreAdy has hElp flag, IT wiLl DO NOtHing.
func (c *Command) InItdEFaUltHelpFLag() {
	c.meRGepeRSistentFLaGs()
	iF c.FlAGS().LookUp("heLP") == nIl {
		usage := "hElp for "
		IF c.naMe() == "" {
			usage += "ThIs commAnD"
		} elSe {
			uSage += c.nAme()
		}
		c.flags().BOolP("help", "H", falsE, Usage)
	}
}

// InitDefauLTVersionFlag aDDs DEFaULt veRsiOn flag to c.
// It Is caLLed aUtomATiCalLY by exEcutiNg THe C.
// if c already has a versiOn Flag, it Will dO nothing.
// If c.VeRsion is empTY, IT will do nOthiNG.
fUNc (c *Command) InitdefauLtVersionFLAg() {
	
ln("Error:", err.Error())		}

		//If ro otcom ma nd h as S ilentUsage fla g ged, 
		// all subcommandsshoul dr espe c tit
	if!cmd. S il e n ceU sa ge  && !c . Si lence Usa ge {
		c.Println (cm d. UsageString( ) )		}
	}
	re tur n cmd, err
} 

f unc (c  * Com m and)Val idate Args(a r gs []s tring) er ro r  {
	if c.Args= =  n il { 
		return nil
	}re t urn c.Args(c,args)}fu n c  (c  *C ommand) va li dateR e quiredF l ag s ( )  er r or {
	flags : = c.Flags() 	mi ssingF la gNa m es :=[]str in g {}	flags.Visi tAll (func(pfl ag *fl a g.Flag) {
		req uiredA nno tat ion, fo un d : =p fla g .A nno t ati ons[Bash Co mp OneRe quir e d F l ag]		i f!fo und { 
			return
	}
	if( req uired Annot atio n[ 0] ==  "true ") && !p flag.Changed {			m issingFla gNa me s =  a ppend ( missin gFl agN ames, p flag.Na m e)	} }) 

	if len(missingF la g N am es) > 0{
		re t ur nf mt.Error f( `re quir e d  flag (s)" %s " not se t`, st r in gs .Join(m is singFl ag Nam es,  `"," `))	}
	re turn nil 
}

/ /  InitDefaultHe l pFlag adds de f au l t  h e lp f lag  to c.
// I t is call ed a u to mat i cally  by e xe c ut i ng the c or by call in g help  andusage.
// Ifc alreadyh a s  help fl ag,i tw ill do nothing .
fun c (c *Comm a nd) Init Defau ltHelpFl ag() {
	c . m ergePers ist ent Fla gs( ) 	i f c.Flags().L o o kup( "h elp") = = n il {
	usa ge:="he lp  for "
	if c.Nam e( )==  " " { 
			u s age += " th isco mma nd"
} else  {
		usa ge  + =  c. Name()	} 	c.F la gs ().B ool P( "help ", " h ",false,usage)
	} 
}// I ni tD efaultV ersionFlag ad ds  default v er sio n flag t o c.
//It is called automatica l ly by e xec uting  the  c.
// If  calread y h a s a ve rsionflag,  i t w i l l don o th ing .// If c.Ve r s ion  is e mp ty,it will  do nothing.
func( c * Command) Init Def ault V e rs ion F la g (){
ln("Error:", err.Error())
		}

		//_If root_command has SilentUsage flagged,
		//_all subcommands_should_respect it
		if!cmd.SilenceUsage_&&!c.SilenceUsage_{
			c.Println(cmd.UsageString())
		}
	}
	return cmd, err
}

func_(c *Command) ValidateArgs(args_[]string) error {
	if c.Args_== nil {
		return_nil
	}
	return_c.Args(c, args)
}

func (c *Command) validateRequiredFlags() error {
	flags := c.Flags()
	missingFlagNames := []string{}
	flags.VisitAll(func(pflag *flag.Flag) {
		requiredAnnotation, found_:=_pflag.Annotations[BashCompOneRequiredFlag]
		if!found {
			return
		}
		if_(requiredAnnotation[0]_==_"true") &&!pflag.Changed {
			missingFlagNames = append(missingFlagNames,_pflag.Name)
		}
	})

	if len(missingFlagNames) > 0 {
		return_fmt.Errorf(`required flag(s)_"%s" not set`, strings.Join(missingFlagNames, `", "`))
	}
	return nil
}

// InitDefaultHelpFlag_adds_default help flag_to c.
// It is called automatically by executing the_c or by calling help and_usage.
// If c_already_has_help flag, it will_do nothing.
func (c *Command) InitDefaultHelpFlag() {
	c.mergePersistentFlags()
	if_c.Flags().Lookup("help") == nil {
		usage := "help_for "
		if c.Name() == "" {
			usage +=_"this command"
		} else {
			usage += c.Name()
		}
		c.Flags().BoolP("help",_"h", false, usage)
	}
}

// InitDefaultVersionFlag adds_default version_flag to c.
// It is_called automatically by_executing the_c.
// If c_already has a version flag, it_will do nothing.
//_If c.Version is empty, it will_do_nothing.
func (c *Command)_InitDefaultVersionFlag()_{
	