|
|
|
@ -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.")] |
|
|
|
|