parent
d4fe9eaa79
commit
81ef166d78
|
|
@ -103,12 +103,20 @@ func redactShellCommand(shellCommand string, arguments []config.ActionArgument,
|
||||||
}
|
}
|
||||||
|
|
||||||
func typecheckActionArgument(name string, value string, action *config.Action) error {
|
func typecheckActionArgument(name string, value string, action *config.Action) error {
|
||||||
|
if name == "" {
|
||||||
|
return fmt.Errorf("argument name cannot be empty")
|
||||||
|
}
|
||||||
|
|
||||||
arg := action.FindArg(name)
|
arg := action.FindArg(name)
|
||||||
|
|
||||||
if arg == nil {
|
if arg == nil {
|
||||||
return fmt.Errorf("action arg not defined: %v", name)
|
return fmt.Errorf("action arg not defined: %v", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return typecheckActionArgumentFound(name, value, action, arg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func typecheckActionArgumentFound(name string, value string, action *config.Action, arg *config.ActionArgument) error {
|
||||||
if value == "" {
|
if value == "" {
|
||||||
return typecheckNull(arg)
|
return typecheckNull(arg)
|
||||||
}
|
}
|
||||||
|
|
@ -210,7 +218,7 @@ func typeSafetyCheckRegex(name string, value string, argumentType string) error
|
||||||
pattern, found = typecheckRegex[argumentType]
|
pattern, found = typecheckRegex[argumentType]
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
return fmt.Errorf("argument type not implemented %v", argumentType)
|
return fmt.Errorf("argument type not implemented %v for arg: %v", argumentType, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ class ArgumentForm extends window.HTMLElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arg.name === "") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
ret.push({
|
ret.push({
|
||||||
name: arg.name,
|
name: arg.name,
|
||||||
value: arg.value
|
value: arg.value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue