mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-09 14:41:31 +02:00
fix: do not print out help string if the parameters are correct
There was an issue that `talosctl apply config` version was printing out the help even if arguments are correct. Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>
This commit is contained in:
parent
56c95eace3
commit
c2e353d6af
@ -42,11 +42,13 @@ var applyConfigCmd = &cobra.Command{
|
|||||||
)
|
)
|
||||||
|
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
cmd.Help() //nolint:errcheck
|
|
||||||
|
|
||||||
if args[0] != "config" && !strings.EqualFold(args[0], "machineconfig") {
|
if args[0] != "config" && !strings.EqualFold(args[0], "machineconfig") {
|
||||||
|
cmd.Help() //nolint:errcheck
|
||||||
|
|
||||||
return fmt.Errorf("unknown positional argument %s", args[0])
|
return fmt.Errorf("unknown positional argument %s", args[0])
|
||||||
} else if cmd.CalledAs() == "apply-config" {
|
} else if cmd.CalledAs() == "apply-config" {
|
||||||
|
cmd.Help() //nolint:errcheck
|
||||||
|
|
||||||
return fmt.Errorf("expected no positional arguments")
|
return fmt.Errorf("expected no positional arguments")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user