namespace Commands module ConsoleCommands = open System open Console.Waterworks open Console.Waterworks.Attributes open SmoulderingBeachBall.Services open Validation open System.IO let showEndOfCommandMessage = "[INFO.] Execution completed." [] [] [] [] let test () = "[SUCCESS] Smouldering Beach Ball CLI seems to be working." [] [] [] [] 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 [] [] [] [] let exit () = Environment.Exit (Environment.ExitCode) [] [] [] [] let ``draw-default`` imgWidth imgHeight = try buildDefaultSpec imgWidth imgHeight |> makeImage |> Async.RunSynchronously showEndOfCommandMessage with | :? ArgumentException as ex -> ex.Message | _ as ex -> ex.Message [] [] [] [] let ``draw-image`` imgWidth imgHeight mainColour oColour oType path = try buildSpec imgWidth imgHeight mainColour oColour oType path |> makeImage |> Async.RunSynchronously showEndOfCommandMessage with | :? ArgumentException as ex -> ex.Message | _ as ex -> ex.Message [] [] [] [] let ``list-colours`` () = printfn "[INFO.] Listing available colours..." for item in colourList do printfn "%s" item.Key showEndOfCommandMessage (* ALIASES ======================================================================= These command-methods will not show up in the help section. Before adding extra aliases, make sure the main version is as clear and helpful to someone new to the program as possible. Aliases should be treated as commands for experienced users and documented on the wiki, hosted alongside the repository on GitHub. URL: https://github.com/CraigOates/Smouldering-Beach-Ball/wiki *) let dd imgWidth imgHeight = ``draw-default`` imgWidth imgHeight let di imgWidth imgHeight mainColour oColour oType path = ``draw-image`` imgWidth imgHeight mainColour oColour oType path let lc () = ``list-colours`` ()