///
/// Returns debug default arguments when running under a debugger and the caller supplied insufficient args.
///
/// Original CLI arguments. May be null.
///
/// The original when populated; otherwise a curated set of debug arguments selected via
/// the environment variable GITCONVERTER_DEBUG_TARGET. In non-DEBUG builds the original args are returned.
///
///
/// - This method is compiled only in DEBUG builds (guarded by #if DEBUG); it has no effect in Release/CI.
/// - Use the environment variable GITCONVERTER_DEBUG_TARGET to pick a scenario (examples: Shapefile1, Csv1, Gml1).
/// - Keep debug defaults out of production binaries to avoid surprising behavior in CI/consumer environments.
///
private static string[] EnsureDebugArgs(string[] args)
{
#if DEBUG
if (args != null && args.Length >= 6)
return args;
// Allow selecting a debug scenario via environment variable.
// Supported values: Shapefile (default), Csv, Gml.
var debugTarget = Environment.GetEnvironmentVariable("GITCONVERTER_DEBUG_TARGET");
switch (debugTarget.Trim().ToLowerInvariant())
{
// Shapefile test cases
case "shapefile1":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Shapefile\Input\ShapeFiles.7z",
"GeoJson",
@"D:\GisConverter\Tests\Shapefile\Output\Shapefile1",
@"D:\GisConverter\Tests\Shapefile\Temp\Shapefile1",
"Log",
@"D:\GisConverter\Tests\Shapefile\Log\shapefile_log1.txt"
};
case "shapefile2":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Shapefile\Input\Vector.7z",
"Shapefile",
@"D:\GisConverter\Tests\Shapefile\Output\Shapefile2",
@"D:\GisConverter\Tests\Shapefile\Temp\Shapefile2",
"Log",
@"D:\GisConverter\Tests\Shapefile\Log\shapefile_log2.txt"
};
case "shapefile3":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Shapefile\Input\לא סטטוטורי - גבול מחוז מאוחד.7z",
"Shapefile",
@"D:\GisConverter\Tests\Shapefile\Output\Shapefile3",
@"D:\GisConverter\Tests\Shapefile\Temp\Shapefile3",
"Log",
@"D:\GisConverter\Tests\Shapefile\Log\shapefile_log3.txt"
};
case "shapefile4":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Shapefile\Input\שכבות מידע (Arc View).7z",
"Shapefile",
@"D:\GisConverter\Tests\Shapefile\Output\Shapefile4",
@"D:\GisConverter\Tests\Shapefile\Temp\Shapefile4",
"Log",
@"D:\GisConverter\Tests\Shapefile\Log\shapefile_log4.txt"
};
// Csv test cases
case "csv1":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Csv\Input\features.7z",
"Csv",
@"D:\GisConverter\Tests\Csv\Output\Csv1",
@"D:\GisConverter\Tests\Csv\Temp\Csv1",
"Log",
@"D:\GisConverter\Tests\Csv\Log\csv_log1.txt"
};
case "csv2":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Csv\Input\features.csv",
"Csv",
@"D:\GisConverter\Tests\Csv\Output\Csv2",
@"D:\GisConverter\Tests\Csv\Temp\Csv2",
"Log",
@"D:\GisConverter\Tests\Csv\Log\csv_log2.txt"
};
case "csv3":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Csv\Input\features.zip",
"Csv",
@"D:\GisConverter\Tests\Csv\Output\Csv3",
@"D:\GisConverter\Tests\Csv\Temp\Csv3",
"Log",
@"D:\GisConverter\Tests\Csv\Log\csv_log3.txt"
};
// Gml test cases
case "gml1":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Gml\Input\gml_with_attribute_collection_schema.7z",
"Gml",
@"D:\GisConverter\Tests\Gml\Output\Gml1",
@"D:\GisConverter\Tests\Gml\Temp\Gml1",
"Log",
@"D:\GisConverter\Tests\Gml\Log\gml_log1.txt"
};
case "gml2":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Gml\Input\gml_with_attribute_collection_schema.zip",
"Gml",
@"D:\GisConverter\Tests\Gml\Output\Gml2",
@"D:\GisConverter\Tests\Gml\Temp\Gml2",
"Log",
@"D:\GisConverter\Tests\Gml\Log\gml_log2.txt"
};
case "gml3":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Gml\Input\gml_without_attribute_collection_schema.7z",
"Gml",
@"D:\GisConverter\Tests\Gml\Output\Gml3",
@"D:\GisConverter\Tests\Gml\Temp\Gml3",
"Log",
@"D:\GisConverter\Tests\Gml\Log\gml_log3.txt"
};
case "gml4":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Gml\Input\gml_without_attribute_collection_schema.gml",
"Gml",
@"D:\GisConverter\Tests\Gml\Output\Gml4",
@"D:\GisConverter\Tests\Gml\Temp\Gml4",
"Log",
@"D:\GisConverter\Tests\Gml\Log\gml_log4.txt"
};
case "gml5":
return new[]
{
"gis_convert",
@"D:\GisConverter\Tests\Gml\Input\gml_without_attribute_collection_schema.zip",
"Gml",
@"D:\GisConverter\Tests\Gml\Output\Gml5",
@"D:\GisConverter\Tests\Gml\Temp\Gml5",
"Log",
@"D:\GisConverter\Tests\Gml\Log\gml_log5.txt"
};
default:
return args ?? Array.Empty();
}
#else
return args ?? Array.Empty();
#endif
}