Modernize invertergui: MQTT write support, HA integration, UI updates
Some checks failed
build / inverter_gui_pipeline (push) Has been cancelled
Some checks failed
build / inverter_gui_pipeline (push) Has been cancelled
This commit is contained in:
15
vendor/github.com/jessevdk/go-flags/parser.go
generated
vendored
15
vendor/github.com/jessevdk/go-flags/parser.go
generated
vendored
@@ -113,6 +113,10 @@ const (
|
||||
// POSIX processing.
|
||||
PassAfterNonOption
|
||||
|
||||
// AllowBoolValues allows a user to assign true/false to a boolean value
|
||||
// rather than raising an error stating it cannot have an argument.
|
||||
AllowBoolValues
|
||||
|
||||
// Default is a convenient default set of options which should cover
|
||||
// most of the uses of the flags package.
|
||||
Default = HelpFlag | PrintErrors | PassDoubleDash
|
||||
@@ -252,7 +256,7 @@ func (p *Parser) ParseArgs(args []string) ([]string, error) {
|
||||
}
|
||||
|
||||
if !argumentIsOption(arg) {
|
||||
if (p.Options&PassAfterNonOption) != None && s.lookup.commands[arg] == nil {
|
||||
if ((p.Options&PassAfterNonOption) != None || s.command.PassAfterNonOption) && s.lookup.commands[arg] == nil {
|
||||
// If PassAfterNonOption is set then all remaining arguments
|
||||
// are considered positional
|
||||
if err = s.addArgs(s.arg); err != nil {
|
||||
@@ -521,11 +525,10 @@ func (p *parseState) estimateCommand() error {
|
||||
|
||||
func (p *Parser) parseOption(s *parseState, name string, option *Option, canarg bool, argument *string) (err error) {
|
||||
if !option.canArgument() {
|
||||
if argument != nil {
|
||||
if argument != nil && (p.Options&AllowBoolValues) == None {
|
||||
return newErrorf(ErrNoArgumentForBool, "bool flag `%s' cannot have an argument", option)
|
||||
}
|
||||
|
||||
err = option.set(nil)
|
||||
err = option.Set(argument)
|
||||
} else if argument != nil || (canarg && !s.eof()) {
|
||||
var arg string
|
||||
|
||||
@@ -546,13 +549,13 @@ func (p *Parser) parseOption(s *parseState, name string, option *Option, canarg
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
err = option.set(&arg)
|
||||
err = option.Set(&arg)
|
||||
}
|
||||
} else if option.OptionalArgument {
|
||||
option.empty()
|
||||
|
||||
for _, v := range option.OptionalValue {
|
||||
err = option.set(&v)
|
||||
err = option.Set(&v)
|
||||
|
||||
if err != nil {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user