|
|
|
namespace Commands
|
|
|
|
|
|
|
|
module ConsoleCommands =
|
|
|
|
|
|
|
|
open System
|
|
|
|
open SmoulderingBeachBall.Services
|
|
|
|
open Validation
|
|
|
|
|
|
|
|
let showEndOfCommandMessage = "[INFO.] Execution completed."
|
|
|
|
|
|
|
|
let test () = "[SUCCESS] Smouldering Beach Ball CLI seems to be working."
|
|
|
|
|
|
|
|
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
|
|
|
|
|