From f564fb6e9eb598a081061fa867a35f1814f594c4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 16 Jan 2023 22:15:45 -0800 Subject: [PATCH] Make JSON handling internally a bit easier --- Test/Printer.cs | 16 ---------------- Test/Program.cs | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Test/Printer.cs b/Test/Printer.cs index 9c734301..a7496766 100644 --- a/Test/Printer.cs +++ b/Test/Printer.cs @@ -16,32 +16,20 @@ namespace Test /// File or directory path /// Enable JSON output, if supported /// Enable debug output -#if NET6_0_OR_GREATER public static void PrintPathInfo(string path, bool json, bool debug) -#else - public static void PrintPathInfo(string path, bool debug) -#endif { Console.WriteLine($"Checking possible path: {path}"); // Check if the file or directory exists if (File.Exists(path)) { -#if NET6_0_OR_GREATER PrintFileInfo(path, json, debug); -#else - PrintFileInfo(path, debug); -#endif } else if (Directory.Exists(path)) { foreach (string file in Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories)) { -#if NET6_0_OR_GREATER PrintFileInfo(file, json, debug); -#else - PrintFileInfo(file, debug); -#endif } } else @@ -53,11 +41,7 @@ namespace Test /// /// Print information for a single file, if possible /// -#if NET6_0_OR_GREATER private static void PrintFileInfo(string file, bool json, bool debug) -#else - private static void PrintFileInfo(string file, bool debug) -#endif { Console.WriteLine($"Attempting to print info for {file}"); diff --git a/Test/Program.cs b/Test/Program.cs index a6fe7d0c..7f816406 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -48,7 +48,7 @@ namespace Test #if NET6_0_OR_GREATER Printer.PrintPathInfo(inputPath, options.Json, options.Debug); #else - Printer.PrintPathInfo(inputPath, options.Debug); + Printer.PrintPathInfo(inputPath, false, options.Debug); #endif // Scanning