Warn messages, docs
This commit is contained in:
@@ -18,7 +18,7 @@ namespace BoerseDataConvert
|
|||||||
private static WarningStat warning;
|
private static WarningStat warning;
|
||||||
public static int Count
|
public static int Count
|
||||||
{
|
{
|
||||||
get { return count; }
|
get { return count - 1; }
|
||||||
}
|
}
|
||||||
public RecordController(string adr, string fileName, string tags)
|
public RecordController(string adr, string fileName, string tags)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ namespace BoerseDataConvert
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine($"INFO: Warnings in {curFile}");
|
Console.Error.WriteLine($"WARN: Warnings in {curFile}");
|
||||||
foreach (var warning in tableWarnings)
|
foreach (var warning in tableWarnings)
|
||||||
{
|
{
|
||||||
int tag = warning.Key;
|
int tag = warning.Key;
|
||||||
int count = warning.Value;
|
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": {
|
"profiles": {
|
||||||
"BoerseDataConvert": {
|
"BoerseDataConvert": {
|
||||||
"commandName": "Project",
|
"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:",
|
"Flags:",
|
||||||
{ "?|h|help", "prints help message", x => helpMessage = true },
|
{ "?|h|help", "prints help message", x => helpMessage = true },
|
||||||
{ "i|input=", "specify input zip file", x => zipFile = x },
|
{ "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 },
|
{ "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
|
{ "<>", v => throw new ArgumentException("ERROR: Invalid arguments") }, // default
|
||||||
"",
|
"",
|
||||||
"Created by D. Delchev and D. Byalkov, 2021"
|
"Created by D. Delchev and D. Byalkov, 2021"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (tagsFile == null)
|
||||||
|
{
|
||||||
|
tagsFile = "tags.txt";
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
p.Parse(args);
|
p.Parse(args);
|
||||||
@@ -65,7 +71,7 @@ namespace BoerseDataConvert
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.Error.WriteLine(e.Message);
|
Console.Error.WriteLine(e.Message);
|
||||||
Environment.Exit(Environment.ExitCode);
|
Environment.Exit(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// only read filenames
|
// only read filenames
|
||||||
@@ -108,7 +114,10 @@ namespace BoerseDataConvert
|
|||||||
}
|
}
|
||||||
static void ZipExtract(string zipFile, string inputDirectory)
|
static void ZipExtract(string zipFile, string inputDirectory)
|
||||||
{
|
{
|
||||||
Directory.Delete(inputDirectory, true);
|
if (Directory.Exists(inputDirectory))
|
||||||
|
{
|
||||||
|
Directory.Delete(inputDirectory, true);
|
||||||
|
}
|
||||||
Directory.CreateDirectory(inputDirectory);
|
Directory.CreateDirectory(inputDirectory);
|
||||||
ZipFile.ExtractToDirectory(zipFile, inputDirectory, true); // zip extract
|
ZipFile.ExtractToDirectory(zipFile, inputDirectory, true); // zip extract
|
||||||
Console.WriteLine("INFO: Successful ZIP extraction");
|
Console.WriteLine("INFO: Successful ZIP extraction");
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ namespace BoerseDataConvert
|
|||||||
count = int.Parse(countStr);
|
count = int.Parse(countStr);
|
||||||
if (count != RecordController.Count)
|
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)
|
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