diff --git a/WetPancakeCLI/ConsoleCommands.cs b/WetPancakeCLI/ConsoleCommands.cs index 5492dfb..e78a0aa 100644 --- a/WetPancakeCLI/ConsoleCommands.cs +++ b/WetPancakeCLI/ConsoleCommands.cs @@ -36,6 +36,42 @@ namespace WetPancakeCLI [Usage("> Help")] public static string Help() => new CW_Liaison().RequestHelpDocumentation("WetPancakeCLI"); + [ListCommand] + [Parameters("filePath: string")] + [Description("Writes a quick guide to the specified location or the desktop if no path was specified.")] + [Usage("/n" + // Added because Console.Waterworks' rendering makes it look weird. + "QuickGuide C:/your/filePath\n" + + "QuickGuide")] + public static string QuickGuide(string filePath = "") + { + WriteLine("Attempting to write the Wet Pancake CLI Quick Guide..."); + try + { + var parentDirectory = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; + var cheatsheetPath = $"{parentDirectory}\\ProductInfo\\quick-guide.pdf"; + if (!File.Exists(cheatsheetPath)) throw new FileNotFoundException(); + if (string.IsNullOrWhiteSpace(filePath)) + { + var desktopDirectory = GetFolderPath(SpecialFolder.Desktop); + var savePath = $"{desktopDirectory}\\wet-pankcake-cheatsheet.pdf"; + File.Copy(cheatsheetPath, savePath, true); + return "Quick Guide written to desktop."; + } + else + { + // TODO; Finish Quick Guide command-method. + if (!Directory.Exists(filePath)) throw new DirectoryNotFoundException(); + return $"Quick Guide added to {filePath}"; + } + + } + catch (Exception e) + { + Debug.WriteLine(e.Message); + throw; + } + } + [ListCommand] [Parameters("None")] [Description("Exits out of the program.")] diff --git a/WetPancakeCLI/ProductInfo/quick-guide.pdf b/WetPancakeCLI/ProductInfo/quick-guide.pdf new file mode 100644 index 0000000..a6b6c7f Binary files /dev/null and b/WetPancakeCLI/ProductInfo/quick-guide.pdf differ diff --git a/WetPancakeCLI/WetPancakeCLI.csproj b/WetPancakeCLI/WetPancakeCLI.csproj index 249747d..dc90a5e 100644 --- a/WetPancakeCLI/WetPancakeCLI.csproj +++ b/WetPancakeCLI/WetPancakeCLI.csproj @@ -95,6 +95,7 @@ +