Death Socket consists of three projects. They are a .Net Standard 2.0 library, a console program and a Test Centre. The purpose of this repository is to provide a way for people to add grids to images.
https://www.craigoates.net/Software/project/13
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
namespace Commands |
|
|
|
module ConsoleCommands = |
|
open System |
|
open DeathSocket.GridPainter |
|
open Validation |
|
open System.IO |
|
|
|
let showEndOfCommandMessage = "[INFO.] Task completed." |
|
|
|
let test () = "Death Socket is working." |
|
|
|
let exit () = Environment.Exit (Environment.ExitCode) |
|
|
|
let ``add-grid`` imgPath numRows numColumns pWidth colour newPath = |
|
try |
|
printfn "[INFO.] Adding grid to image..." |
|
buildSpec imgPath numRows numColumns pWidth colour 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 ``list-colours`` () = |
|
printfn "[INFO.] Listing available colours..." |
|
for item in colourList do |
|
printfn "%s" item.Key |
|
showEndOfCommandMessage |