Browse Source

Add quick-guide.pdf to CLI project.

Write working but unfinished QuickGuide command-method.
master
Craig Oates 6 years ago
parent
commit
e87f5d887e
  1. 36
      WetPancakeCLI/ConsoleCommands.cs
  2. BIN
      WetPancakeCLI/ProductInfo/quick-guide.pdf
  3. 1
      WetPancakeCLI/WetPancakeCLI.csproj

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

BIN
WetPancakeCLI/ProductInfo/quick-guide.pdf

Binary file not shown.

1
WetPancakeCLI/WetPancakeCLI.csproj

@ -95,6 +95,7 @@
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="ProductInfo\quick-guide.pdf" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WetPancake\WetPancake.fsproj">

Loading…
Cancel
Save