|
|
@ -3,15 +3,38 @@ |
|
|
|
module ConsoleCommands = |
|
|
|
module ConsoleCommands = |
|
|
|
|
|
|
|
|
|
|
|
open System |
|
|
|
open System |
|
|
|
|
|
|
|
open Console.Waterworks |
|
|
|
|
|
|
|
open Console.Waterworks.Attributes |
|
|
|
open SmoulderingBeachBall.Services |
|
|
|
open SmoulderingBeachBall.Services |
|
|
|
open Validation |
|
|
|
open Validation |
|
|
|
|
|
|
|
|
|
|
|
let showEndOfCommandMessage = "[INFO.] Execution completed." |
|
|
|
let showEndOfCommandMessage = "[INFO.] Execution completed." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<ListCommand>] |
|
|
|
|
|
|
|
[<Description |
|
|
|
|
|
|
|
"Display a text message indicating this program is running properly.">] |
|
|
|
|
|
|
|
[<Parameters "none">] |
|
|
|
|
|
|
|
[<Usage "test">] |
|
|
|
let test () = "[SUCCESS] Smouldering Beach Ball CLI seems to be working." |
|
|
|
let test () = "[SUCCESS] Smouldering Beach Ball CLI seems to be working." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<ListCommand>] |
|
|
|
|
|
|
|
[<Description "Displays a list of available commands provided by this porgram.">] |
|
|
|
|
|
|
|
[<Parameters "none">] |
|
|
|
|
|
|
|
[<Usage "help">] |
|
|
|
|
|
|
|
let help () = CW_Liaison().RequestHelpDocumentation("Commands") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<ListCommand>] |
|
|
|
|
|
|
|
[<Description "Exits of out the program.">] |
|
|
|
|
|
|
|
[<Parameters "none">] |
|
|
|
|
|
|
|
[<Usage "exit">] |
|
|
|
let exit () = Environment.Exit (Environment.ExitCode) |
|
|
|
let exit () = Environment.Exit (Environment.ExitCode) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<ListCommand>] |
|
|
|
|
|
|
|
[<Description |
|
|
|
|
|
|
|
("Saves an image to the desktop, using the default setting.\n" + |
|
|
|
|
|
|
|
"The user must specify the width and the height of the image.")>] |
|
|
|
|
|
|
|
[<Parameters "(image-width: int) (image-height: int)" >] |
|
|
|
|
|
|
|
[<Usage "draw-default 500 500">] |
|
|
|
let ``draw-default`` imgWidth imgHeight = |
|
|
|
let ``draw-default`` imgWidth imgHeight = |
|
|
|
try |
|
|
|
try |
|
|
|
buildDefaultSpec imgWidth imgHeight |
|
|
|
buildDefaultSpec imgWidth imgHeight |
|
|
@ -22,6 +45,20 @@ |
|
|
|
| :? ArgumentException as ex -> ex.Message |
|
|
|
| :? ArgumentException as ex -> ex.Message |
|
|
|
| _ as ex -> ex.Message |
|
|
|
| _ as ex -> ex.Message |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[<ListCommand>] |
|
|
|
|
|
|
|
[<Description |
|
|
|
|
|
|
|
("Creates an image using the values specified by the user.\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'." + |
|
|
|
|
|
|
|
"For the file path, you can enter 'desktop' to save to the desktop." + |
|
|
|
|
|
|
|
"Otherwise, you must specify the whole path.")>] |
|
|
|
|
|
|
|
[<Parameters |
|
|
|
|
|
|
|
("(image-width: int) (image-height: int) (main-colour: string)" + |
|
|
|
|
|
|
|
"(overlay-colour: string) (overlay-type:string) (file-path: string)")>] |
|
|
|
|
|
|
|
[<Usage |
|
|
|
|
|
|
|
("\ndraw-image 770 400 white black full desktop\n" + |
|
|
|
|
|
|
|
"draw-image 600 400 purple gray border C:/work/project-folder/images\n" + |
|
|
|
|
|
|
|
"draw-image 800 440 black - none D:/your-project/assets")>] |
|
|
|
let ``draw-image`` imgWidth imgHeight mainColour oColour oType path = |
|
|
|
let ``draw-image`` imgWidth imgHeight mainColour oColour oType path = |
|
|
|
try |
|
|
|
try |
|
|
|
buildSpec imgWidth imgHeight mainColour oColour oType path |
|
|
|
buildSpec imgWidth imgHeight mainColour oColour oType path |
|
|
|