Skip to content

Commit

Permalink
Parse encoding argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Feb 2, 2024
1 parent 13cb4ed commit 71a7caf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions FindInFilesForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ public FindInFilesForm(string[] args) {
comboBoxSearchPattern.Items.AddRange(settings.SearchPatternHistory);
textBoxEncoding.Text = defaultEncoding;
var searchPath = false;
foreach (var arg in args) {
if (Util.PathExists(arg).exist) {
for (var index = 0; index < args.Length; index++) {
var arg = args[index];
if (arg == "-E" && index + 1 < args.Length) {
++index;
textBoxEncoding.Text = args[index];
} else if (Util.PathExists(arg).exist) {
searchPath = true;
comboBoxSearchPath.Text = arg;
break;
Expand Down
8 changes: 6 additions & 2 deletions NET48/FindInFilesForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ public FindInFilesForm(string[] args) {
comboBoxSearchPattern.Items.AddRange(settings.SearchPatternHistory);
textBoxEncoding.Text = defaultEncoding;
var searchPath = false;
foreach (var arg in args) {
if (Util.PathExists(arg).exist) {
for (var index = 0; index < args.Length; index++) {
var arg = args[index];
if (arg == "-E" && index + 1 < args.Length) {
++index;
textBoxEncoding.Text = args[index];
} else if (Util.PathExists(arg).exist) {
searchPath = true;
comboBoxSearchPath.Text = arg;
break;
Expand Down

0 comments on commit 71a7caf

Please sign in to comment.