Skip to content

Commit 3c9b094

Browse files
author
snzen
committed
..
1 parent 54dc359 commit 3c9b094

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

FilesCore/Concat.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ public class Concat : IUtil
88
{
99
public string Name => "concat";
1010
public string Info => "Concatenates text files." + Environment.NewLine +
11-
"Args: not interactive (-ni), out-file (-out), files [separated by comma] (-files) " +
11+
"Args: not interactive (-ni), out-file (-out), paths map file [separated by new line] (-files) " +
1212
"new-line-separator (-fsep)";
1313

1414
public int Run(RunArgs ra)
1515
{
1616
bool interactive = !ra.InArgs.ContainsKey("-ni");
1717
var allText = string.Empty;
1818
var outFile = string.Empty;
19-
var toBeJoined = string.Empty;
19+
var fileMap = string.Empty;
2020
var newLinefileSep = false;
2121

2222
if (interactive)
2323
{
2424
Utils.ReadString("Out file path: ", ref outFile, true);
25-
Utils.ReadString("The file paths separated by comma: ", ref toBeJoined, true);
25+
Utils.ReadString("The file paths map: ", ref fileMap, true);
2626

2727
var newLine = string.Empty;
2828
Utils.ReadString("Add new line before each file? (y/*): ", ref newLine);
@@ -33,14 +33,14 @@ public int Run(RunArgs ra)
3333
if (ra.InArgs.ContainsKey("-out")) outFile = ra.InArgs.GetFirstValue("-out");
3434
else throw new ArgumentNullException("-out");
3535

36-
if (ra.InArgs.ContainsKey("-files")) toBeJoined = ra.InArgs.GetFirstValue("-files");
36+
if (ra.InArgs.ContainsKey("-files")) fileMap = ra.InArgs.GetFirstValue("-files");
3737
else throw new ArgumentNullException("-files");
3838

3939
if (ra.InArgs.ContainsKey("-fsep")) newLinefileSep = true;
4040
}
4141

4242
var sb = new StringBuilder();
43-
var F = toBeJoined.Split(FILE_SPLITTER);
43+
var F = File.ReadAllLines(fileMap);
4444
var counter = 0;
4545

4646

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ files -p ext -ni -sp *.png -ext jpg
3939

4040
not interactive (-ni)
4141
out-file (-out)
42-
files [separated by comma] (-files)
42+
paths map file [separated by new line] (-files)
4343
add a new line before each file content (-fsep)
4444

4545
### fcopy

0 commit comments

Comments
 (0)