Warn messages, docs
This commit is contained in:
@@ -18,7 +18,7 @@ namespace BoerseDataConvert
|
||||
private static WarningStat warning;
|
||||
public static int Count
|
||||
{
|
||||
get { return count; }
|
||||
get { return count - 1; }
|
||||
}
|
||||
public RecordController(string adr, string fileName, string tags)
|
||||
{
|
||||
|
||||
@@ -34,12 +34,12 @@ namespace BoerseDataConvert
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"INFO: Warnings in {curFile}");
|
||||
Console.Error.WriteLine($"WARN: Warnings in {curFile}");
|
||||
foreach (var warning in tableWarnings)
|
||||
{
|
||||
int tag = warning.Key;
|
||||
int count = warning.Value;
|
||||
Console.WriteLine($"INFO: Invalid tag \"{tag}\": {count} times.");
|
||||
Console.Error.WriteLine($"WARN: Invalid tag \"{tag}\": {count} times.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"profiles": {
|
||||
"BoerseDataConvert": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "-i TestData-2021_07_02.zip -d input -o output -t \"D:\\Code\\ИТ Кариера\\Стаж\\github\\BoerseDataConvert\\tags.txt\""
|
||||
"commandLineArgs": "-i smalldata.zip -d input -o output"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,14 +43,20 @@ namespace BoerseDataConvert
|
||||
"Flags:",
|
||||
{ "?|h|help", "prints help message", x => helpMessage = true },
|
||||
{ "i|input=", "specify input zip file", x => zipFile = x },
|
||||
{ "d|directory=", "specify input directory", x => inputDirectory = x },
|
||||
{ "d|directory=", "specify working directory", x => inputDirectory = x },
|
||||
"The working directory is cleared recursively if it isn't empty!",
|
||||
{ "o|output=", "specify output directory", x => outputDirectory = x },
|
||||
{ "t|tags=", "specify tag file", x => { if (x != "") tagsFile = x; } },
|
||||
{ "t|tags=", "specify tag file", x => tagsFile = x },
|
||||
{ "<>", v => throw new ArgumentException("ERROR: Invalid arguments") }, // default
|
||||
"",
|
||||
"Created by D. Delchev and D. Byalkov, 2021"
|
||||
};
|
||||
|
||||
if (tagsFile == null)
|
||||
{
|
||||
tagsFile = "tags.txt";
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
p.Parse(args);
|
||||
@@ -65,7 +71,7 @@ namespace BoerseDataConvert
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.Error.WriteLine(e.Message);
|
||||
Environment.Exit(Environment.ExitCode);
|
||||
Environment.Exit(3);
|
||||
}
|
||||
|
||||
// only read filenames
|
||||
@@ -108,7 +114,10 @@ namespace BoerseDataConvert
|
||||
}
|
||||
static void ZipExtract(string zipFile, string inputDirectory)
|
||||
{
|
||||
Directory.Delete(inputDirectory, true);
|
||||
if (Directory.Exists(inputDirectory))
|
||||
{
|
||||
Directory.Delete(inputDirectory, true);
|
||||
}
|
||||
Directory.CreateDirectory(inputDirectory);
|
||||
ZipFile.ExtractToDirectory(zipFile, inputDirectory, true); // zip extract
|
||||
Console.WriteLine("INFO: Successful ZIP extraction");
|
||||
|
||||
@@ -75,12 +75,12 @@ namespace BoerseDataConvert
|
||||
count = int.Parse(countStr);
|
||||
if (count != RecordController.Count)
|
||||
{
|
||||
Console.WriteLine($"Count on file {filesNames[fileInd]} is not correct! Real count is {RecordController.Count}");
|
||||
Console.Error.WriteLine($"WARN: Count on file {filesNames[fileInd]} is not correct! Real count is {RecordController.Count}");
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Console.WriteLine($"Count on file {filesNames[fileInd]} is not in the correct format");
|
||||
Console.Error.WriteLine($"WARN: Count on file {filesNames[fileInd]} is not in the correct format");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user