mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
fix: reject negative indent instead of panicking (#2746)
This commit is contained in:
@@ -87,6 +87,10 @@ func validateCommandFlags(args []string) error {
|
||||
return fmt.Errorf("cannot pass files in when using null-input flag")
|
||||
}
|
||||
|
||||
if indent < 0 {
|
||||
return fmt.Errorf("indent must not be negative")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user