cli
                                
                                
                                
                                    cli copied to clipboard
                            
                            
                            
                        Is there an easy way to toggle the Required attribute of a cli.Flag ?
Now I have to create separate cli.Flag flag instances for Required and Optional, which is quite tedious:
// HeightFlag ...
var HeightFlag = cli.IntFlag{
	Name:     "height",
	Usage:    "specify height",
	Required: true,
}
// OptionalHeightFlag ...
var OptionalHeightFlag = cli.IntFlag{
	Name:  "height",
	Usage: "specify optional height",
}
                                    
                                    
                                    
                                
What about
OptionalHeightFlag := HeightFlag
OptionalHeightFlag.Required = False
                                    
                                    
                                    
                                
What about
OptionalHeightFlag := HeightFlag OptionalHeightFlag.Required = False
It still requires 2 variables, if there is a method like ToggleRequired(), then only 1 is enough.
Interface cannot be update to include these functions at this point. Please consider using v3x