Browse Source

include add-default command in CLI.

Add functionality to build a default image-spec. record.
master
Craig Oates 6 years ago
parent
commit
d0d13c17ba
  1. 12
      DeathSocketCLI/Commands.fs
  2. 10
      DeathSocketCLI/Validation.fs

12
DeathSocketCLI/Commands.fs

@ -12,6 +12,18 @@
let exit () = Environment.Exit (Environment.ExitCode)
let ``add-default`` imgPath newPath =
try
printfn "[INFO.] Adding default grid to image..."
buildDefaultSpec imgPath newPath
|> applyGrid
|> Async.RunSynchronously
showEndOfCommandMessage
with
| :? FileNotFoundException as ex -> "[ERROR] No file was found at " + ex.FileName
| :? ArgumentException as ex -> "[ERROR] Invalid argument: " + ex.Message
| _ as ex -> ex.Message
let ``add-grid`` imgPath numRows numColumns pWidth colour newPath =
try
printfn "[INFO.] Adding grid to image..."

10
DeathSocketCLI/Validation.fs

@ -36,4 +36,12 @@
colour = parseColour colour
penWidth = pWidth
rows = numRows
columns = numColumns }
columns = numColumns }
let buildDefaultSpec imgPath newPath =
{ originalPath = imgPath
savePath = newPath
colour = Brushes.White
penWidth = float32 (2)
rows = 10
columns = 10 }
Loading…
Cancel
Save