Skip to content

Commit

Permalink
[#] Fix paste command. more tips
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyadanli committed May 16, 2021
1 parent 561ab97 commit 58bcab6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
15 changes: 12 additions & 3 deletions PasteEx/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions PasteEx/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@
<data name="TipMonitorProcessExisted" xml:space="preserve">
<value>The monitor process already exists.Two monitors can not exist at the same time!</value>
</data>
<data name="TipParseCommandActionError" xml:space="preserve">
<value>Invalid Command.</value>
</data>
<data name="TipParseCommandError" xml:space="preserve">
<value>Can't parse incoming parameters. Make sure that the second parameter begins with '-'</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions PasteEx/Resources/Strings.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@
<data name="TipParseCommandError" xml:space="preserve">
<value>无法解析该命令参数,请确认参数前是否有 ‘-’</value>
</data>
<data name="TipParseCommandActionError" xml:space="preserve">
<value>无效的指令</value>
</data>
</root>
3 changes: 3 additions & 0 deletions PasteEx/Resources/Strings.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@
<data name="TipParseCommandError" xml:space="preserve">
<value>無法解析該命令參數,請確認參數前是否有 ‘-’</value>
</data>
<data name="TipParseCommandActionError" xml:space="preserve">
<value>無效的指令</value>
</data>
</root>
8 changes: 5 additions & 3 deletions PasteEx/Util/CLIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ private void ParseCommand(string[] args)
List<string> argList = new List<string>();

// 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);
}
Expand All @@ -63,7 +65,7 @@ private void ParseCommand(string[] args)
}
else
{
Console.WriteLine("");
Console.WriteLine(Resources.Strings.TipParseCommandActionError);
return;
}

Expand Down

0 comments on commit 58bcab6

Please sign in to comment.