mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-08 22:21:16 +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 {
|
||||
cmd.Help() //nolint:errcheck
|
||||
|
||||
if args[0] != "config" && !strings.EqualFold(args[0], "machineconfig") {
|
||||
cmd.Help() //nolint:errcheck
|
||||
|
||||
return fmt.Errorf("unknown positional argument %s", args[0])
|
||||
} else if cmd.CalledAs() == "apply-config" {
|
||||
cmd.Help() //nolint:errcheck
|
||||
|
||||
return fmt.Errorf("expected no positional arguments")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user