diff --git a/DeathSocketCLI/Commands.fs b/DeathSocketCLI/Commands.fs index 7b605e6..f6359ee 100644 --- a/DeathSocketCLI/Commands.fs +++ b/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..." diff --git a/DeathSocketCLI/Validation.fs b/DeathSocketCLI/Validation.fs index 600ff99..5deb9db 100644 --- a/DeathSocketCLI/Validation.fs +++ b/DeathSocketCLI/Validation.fs @@ -36,4 +36,12 @@ colour = parseColour colour penWidth = pWidth rows = numRows - columns = numColumns } \ No newline at end of file + columns = numColumns } + + let buildDefaultSpec imgPath newPath = + { originalPath = imgPath + savePath = newPath + colour = Brushes.White + penWidth = float32 (2) + rows = 10 + columns = 10 } \ No newline at end of file