From 81d92246584945e88568b68ec5d9600036999f40 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Sun, 26 Oct 2025 16:22:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewerCLI/ExportCommand.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SpineViewerCLI/ExportCommand.cs b/SpineViewerCLI/ExportCommand.cs index 35c7900..a2289a9 100644 --- a/SpineViewerCLI/ExportCommand.cs +++ b/SpineViewerCLI/ExportCommand.cs @@ -255,14 +255,19 @@ namespace SpineViewerCLI }; OptScale.Validators.Add(r => { - if (r.Tokens.Count > 0 && float.TryParse(r.Tokens[0].Value, out var val) && val < 0) + if (r.Tokens.Count > 0 && float.TryParse(r.Tokens[0].Value, out var v) && v < 0) r.AddError($"{OptScale.Name} must be non-negative."); }); OptTime.Validators.Add(r => { - if (r.Tokens.Count > 0 && float.TryParse(r.Tokens[0].Value, out var val) && val < 0) + if (r.Tokens.Count > 0 && float.TryParse(r.Tokens[0].Value, out var v) && v < 0) r.AddError($"{OptTime.Name} must be non-negative."); }); + OptSpeed.Validators.Add(r => + { + if (r.Tokens.Count > 0 && float.TryParse(r.Tokens[0].Value, out var v) && v < 0) + r.AddError($"{OptSpeed.Name} must be non-negative."); + }); // 用反射查找自己所有的公开属性是 Argument 或者 Option 的 foreach (var prop in GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))