Browse Source

add cheat-sheet command in the console project.

master
Craig Oates 6 years ago
parent
commit
883b4d99e5
  1. 18
      SmoulderingBeachBallCLI/ConsoleCommands.fs
  2. 1
      SmoulderingBeachBallCLI/SmoulderingBeachBallCLI.fsproj
  3. BIN
      SmoulderingBeachBallCLI/cheat-sheet.pdf

18
SmoulderingBeachBallCLI/ConsoleCommands.fs

@ -7,6 +7,7 @@
open Console.Waterworks.Attributes open Console.Waterworks.Attributes
open SmoulderingBeachBall.Services open SmoulderingBeachBall.Services
open Validation open Validation
open System.IO
let showEndOfCommandMessage = "[INFO.] Execution completed." let showEndOfCommandMessage = "[INFO.] Execution completed."
@ -19,10 +20,21 @@
[<ListCommand>] [<ListCommand>]
[<Parameters "none">] [<Parameters "none">]
[<Description "Displays a list of available commands provided by this porgram.">] [<Description "Displays a list of available commands provided by this program.">]
[<Usage "help">] [<Usage "help">]
let help () = CW_Liaison().RequestHelpDocumentation("Commands") let help () = CW_Liaison().RequestHelpDocumentation("Commands")
let cheat () =
try
printfn "[INFO] Attempting to save cheat sheet to the desktop..."
let cheatSheetPath = __SOURCE_DIRECTORY__ + "/cheat-sheet.pdf"
let savePath = getDesktopPath + "/smouldering-beach-ball-cheat-sheet.pdf"
File.Copy (cheatSheetPath, savePath, true)
showEndOfCommandMessage
with
| :? FileNotFoundException as ex -> ex.Message
| _ as ex -> ex.Message
[<ListCommand>] [<ListCommand>]
[<Parameters "none">] [<Parameters "none">]
[<Description "Exits of out the program.">] [<Description "Exits of out the program.">]
@ -47,12 +59,12 @@
[<ListCommand>] [<ListCommand>]
[<Parameters [<Parameters
("(image-width: int) (image-height: int) (main-colour: string)" + ("(image-width: int) (image-height: int) (main-colour: string) " +
"(overlay-colour: string) (overlay-type:string) (file-path: string)")>] "(overlay-colour: string) (overlay-type:string) (file-path: string)")>]
[<Description [<Description
("\nCreates an image using the values specified by the user.\n" + ("\nCreates an image using the values specified by the user.\n" +
"To see a list of available colours use the 'list-colours' command.\n" + "To see a list of available colours use the 'list-colours' command.\n" +
"For the overlay-type you can enter either 'none', 'border' or 'full'\n." + "For the overlay-type you can enter either 'none', 'border' or 'full.'\n" +
"For the file path, you can enter 'desktop' to save to the desktop." + "For the file path, you can enter 'desktop' to save to the desktop." +
"Otherwise, you must specify the whole path.")>] "Otherwise, you must specify the whole path.")>]
[<Usage [<Usage

1
SmoulderingBeachBallCLI/SmoulderingBeachBallCLI.fsproj

@ -56,6 +56,7 @@
<Content Include="packages.config" /> <Content Include="packages.config" />
<Content Include="icon.ico" /> <Content Include="icon.ico" />
<None Include="AppIcon.res" /> <None Include="AppIcon.res" />
<None Include="cheat-sheet.pdf" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Console.Waterworks"> <Reference Include="Console.Waterworks">

BIN
SmoulderingBeachBallCLI/cheat-sheet.pdf

Binary file not shown.
Loading…
Cancel
Save