From 5caf0fd970b6e7943f6438ba21ea04cafaf34699 Mon Sep 17 00:00:00 2001 From: VitorGoatman Date: Sun, 20 Nov 2022 18:47:32 -0300 Subject: [PATCH] Update CLI flags for better scripting --- README.md | 18 +++++++++--------- geomancer.nimble | 2 +- src/geomancer.nim | 26 +++++++++++++------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9462ef5..da729dd 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ nimble install geomancer ## Usage You can get a random geomancy reading with -the command `geomancer chart` which will give +the command `geomancer -c/--chart` which will give you a shield chart like this one ``` -$ geomancer chart +$ geomancer --chart Shield Chart +---Daughters---+----Mothers----+ |• •| • |• •|• •| • |• •|• •|• •| @@ -50,11 +50,11 @@ Shield Chart ``` You can get an additional house chart for -more detailed readings by adding the `house` +more detailed readings by adding the `-h/--house` option. ``` -$ geomancer chart house +$ geomancer -ch Shield Chart +---Daughters---+----Mothers----+ | • |• •| • | • |• •| • | • | • | @@ -115,7 +115,7 @@ Caput/Cauda Draconis and Fortuna Major/Minor in quotes. ``` -$ geomancer chart -b "Caput Draconis" Via Puer Albus +$ geomancer -cb "Caput Draconis" Via Puer Albus Shield Chart +---Daughters---+----Mothers----+ |• •| • | • | • |• •| • | • | • | @@ -144,7 +144,7 @@ Alternatively, you can use a minimalist notation for each figure using the `.` and `:` characters. ``` -$ geomancer chart --build .:.. :.:. :..: :::. +$ geomancer -c --build .:.. :.:. :..: :::. Shield Chart +---Daughters---+----Mothers----+ | • | • |• •| • |• •|• •|• •| • | @@ -169,11 +169,11 @@ Shield Chart +-------------------------------+ ``` -You can combine any two figures together with the `sum` +You can combine any two figures together with the `-s/--sum` command. ``` -$ geomancer sum ::.: ..:. +$ geomancer --sum ::.: ..:. Combination of 1: Albus and 2: Puer 1 2 @@ -190,7 +190,7 @@ Combination of 1: Albus and 2: Puer ``` Finally, you get basic information on any figure with -the `info` command. +the `-i/--info` command. ``` $ geomancer info Carcer diff --git a/geomancer.nimble b/geomancer.nimble index 6a28255..ec7437d 100644 --- a/geomancer.nimble +++ b/geomancer.nimble @@ -1,6 +1,6 @@ # Package -version = "1.0.2" +version = "1.0.3" author = "VitorGoatman" description = "A library and program for getting geomancy charts and figures." license = "Unlicense" diff --git a/src/geomancer.nim b/src/geomancer.nim index 5036eb4..a22c6e2 100644 --- a/src/geomancer.nim +++ b/src/geomancer.nim @@ -7,22 +7,22 @@ const Geomancer Usage: - geomancer chart [house] [(-b | --build) ] - geomancer sum - geomancer info - geomancer (-h | --help) + geomancer (-c | --chart) [(-h | --house)] [(-b | --build) ] + geomancer (-s | --sum) + geomancer (-i | --info) + geomancer (-? | --help) Options: - -h --help Show this screen. + -? --help Show this screen. --version Show version. - chart Generates a shield chart + -c --chart Generates a shield chart of the reading. - house Generates a house chart + -h --house Generates a house chart of the reading. -b --build Input the four mothers and build a chart from them. - sum Combines two figures. - info Returns basic information + -s --sum Combines two figures. + -i --info Returns basic information about a figure. """ @@ -57,7 +57,7 @@ proc chart() = rw = reading.rw ju = reading.ju echo fmt shieldmsg - if args["house"]: + if args["--house"]: echo fmt housemsg proc sum(name1,name2:string)= @@ -75,9 +75,9 @@ proc sum(name1,name2:string)= echo fmt summsg when isMainModule: - if args["chart"]: chart() - if args["sum"]: sum($args[""],$args[""]) - if args["info"]: + if args["--chart"]: chart() + if args["--sum"]: sum($args[""],$args[""]) + if args["--info"]: let f = matchFig $args[""] echo infomsg.fmt echo "Commentary: ",f.commentary.wrapWords(),"\n"