From 58bcab67abda98466d377dd689ecffc7b49b3ed2 Mon Sep 17 00:00:00 2001 From: huiyadanli Date: Sun, 16 May 2021 14:11:17 +0800 Subject: [PATCH] [#] Fix paste command. more tips --- PasteEx/Resources/Strings.Designer.cs | 15 ++++++++++++--- PasteEx/Resources/Strings.resx | 3 +++ PasteEx/Resources/Strings.zh-CN.resx | 3 +++ PasteEx/Resources/Strings.zh-Hant.resx | 3 +++ PasteEx/Util/CLIHelper.cs | 8 +++++--- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/PasteEx/Resources/Strings.Designer.cs b/PasteEx/Resources/Strings.Designer.cs index c3dd481..e3ec0f8 100644 --- a/PasteEx/Resources/Strings.Designer.cs +++ b/PasteEx/Resources/Strings.Designer.cs @@ -19,7 +19,7 @@ namespace PasteEx.Resources { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { @@ -47,8 +47,8 @@ internal Strings() { } /// - /// 重写当前线程的 CurrentUICulture 属性 - /// 重写当前线程的 CurrentUICulture 属性。 + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -195,6 +195,15 @@ internal static string TipMonitorProcessExisted { } } + /// + /// 查找类似 Invalid Command. 的本地化字符串。 + /// + internal static string TipParseCommandActionError { + get { + return ResourceManager.GetString("TipParseCommandActionError", resourceCulture); + } + } + /// /// 查找类似 Can't parse incoming parameters. Make sure that the second parameter begins with '-' 的本地化字符串。 /// diff --git a/PasteEx/Resources/Strings.resx b/PasteEx/Resources/Strings.resx index 484d79a..0deb69c 100644 --- a/PasteEx/Resources/Strings.resx +++ b/PasteEx/Resources/Strings.resx @@ -162,6 +162,9 @@ The monitor process already exists.Two monitors can not exist at the same time! + + Invalid Command. + Can't parse incoming parameters. Make sure that the second parameter begins with '-' diff --git a/PasteEx/Resources/Strings.zh-CN.resx b/PasteEx/Resources/Strings.zh-CN.resx index 7bcff81..2558bb3 100644 --- a/PasteEx/Resources/Strings.zh-CN.resx +++ b/PasteEx/Resources/Strings.zh-CN.resx @@ -228,4 +228,7 @@ 无法解析该命令参数,请确认参数前是否有 ‘-’ + + 无效的指令 + \ No newline at end of file diff --git a/PasteEx/Resources/Strings.zh-Hant.resx b/PasteEx/Resources/Strings.zh-Hant.resx index f07bd04..924233c 100644 --- a/PasteEx/Resources/Strings.zh-Hant.resx +++ b/PasteEx/Resources/Strings.zh-Hant.resx @@ -228,4 +228,7 @@ 無法解析該命令參數,請確認參數前是否有 ‘-’ + + 無效的指令 + \ No newline at end of file diff --git a/PasteEx/Util/CLIHelper.cs b/PasteEx/Util/CLIHelper.cs index 73dc367..3e2a9f1 100644 --- a/PasteEx/Util/CLIHelper.cs +++ b/PasteEx/Util/CLIHelper.cs @@ -50,8 +50,10 @@ private void ParseCommand(string[] args) List argList = new List(); // paste can be omitted. - // eg. PasteEx [-q] path - if (args[0].Contains("-")) + // eg. + // PasteEx.exe "c:\" + // PasteEx.exe -q "c:\" + if (args[0].StartsWith("-") || Directory.Exists(args[0])) { argList.Add(CLIParams.PASTE); } @@ -63,7 +65,7 @@ private void ParseCommand(string[] args) } else { - Console.WriteLine(""); + Console.WriteLine(Resources.Strings.TipParseCommandActionError); return; }