[#40] add -h and -? as aliases for --help

This commit is contained in:
Michiel Borkent 2019-08-31 20:21:39 +02:00
parent 2dbb749e35
commit f1d7ed78e5
2 changed files with 5 additions and 5 deletions

View file

@ -96,12 +96,11 @@ You may also download a binary from [Github](https://github.com/borkdude/babashk
## Usage
``` shellsession
$ bb --help
Usage: bb [ --help ] | [ --version ] | [ -i | -I ] [ -o | -O ] [ --stream ] ( expression | -f <file> )
Usage: bb [ --help ] | [ --version ] | [ -i | -I ] [ -o | -O ] [ --stream ] ( expression | -f <file> | --socket-repl [host:]port )
Options:
--help: print this help text.
--help, -h or -?: print this help text.
--version: print the current version of babashka.
-i: bind *in* to a lazy seq of lines from stdin.
@ -110,6 +109,7 @@ Options:
-O: write EDN values to stdout.
--stream: stream over lines or EDN values from stdin. Combined with -i or -I *in* becomes a single value per iteration.
--file or -f: read expressions from file instead of argument wrapped in an implicit do.
--socket-repl: start socket REPL. Specify port (e.g. 1666) or host and port separated by colon (e.g. 127.0.0.1:1666).
--time: print execution time before exiting.
```

View file

@ -24,7 +24,7 @@
(if-let [opt (first options)]
(case opt
("--version") {:version true}
("--help") {:help? true}
("--help" "-h" "-?") {:help? true}
("--stream") (recur (rest options)
(assoc opts-map
:stream? true))
@ -98,7 +98,7 @@
(println)
(println "Options:")
(println "
--help: print this help text.
--help, -h or -?: print this help text.
--version: print the current version of babashka.
-i: bind *in* to a lazy seq of lines from stdin.