Skip to content

Commit

Permalink
Update CLI flags for better scripting
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorGoatman committed Nov 20, 2022
1 parent a3abcd6 commit 5caf0fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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----+
|• •| • |• •|• •| • |• •|• •|• •|
Expand All @@ -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----+
| • |• •| • | • |• •| • | • | • |
Expand Down Expand Up @@ -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----+
|• •| • | • | • |• •| • | • | • |
Expand Down Expand Up @@ -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----+
| • | • |• •| • |• •|• •|• •| • |
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion geomancer.nimble
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
26 changes: 13 additions & 13 deletions src/geomancer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ const
Geomancer
Usage:
geomancer chart [house] [(-b | --build) <m1> <m2> <m3> <m4>]
geomancer sum <figure1> <figure2>
geomancer info <name>
geomancer (-h | --help)
geomancer (-c | --chart) [(-h | --house)] [(-b | --build) <m1> <m2> <m3> <m4>]
geomancer (-s | --sum) <figure1> <figure2>
geomancer (-i | --info) <name>
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.
"""

Expand Down Expand Up @@ -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)=
Expand All @@ -75,9 +75,9 @@ proc sum(name1,name2:string)=
echo fmt summsg

when isMainModule:
if args["chart"]: chart()
if args["sum"]: sum($args["<figure1>"],$args["<figure2>"])
if args["info"]:
if args["--chart"]: chart()
if args["--sum"]: sum($args["<figure1>"],$args["<figure2>"])
if args["--info"]:
let f = matchFig $args["<name>"]
echo infomsg.fmt
echo "Commentary: ",f.commentary.wrapWords(),"\n"
Expand Down

0 comments on commit 5caf0fd

Please sign in to comment.