[#40] add -h and -? as aliases for --help
This commit is contained in:
parent
2dbb749e35
commit
f1d7ed78e5
2 changed files with 5 additions and 5 deletions
|
|
@ -96,12 +96,11 @@ You may also download a binary from [Github](https://github.com/borkdude/babashk
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
``` shellsession
|
``` shellsession
|
||||||
$ bb --help
|
Usage: bb [ --help ] | [ --version ] | [ -i | -I ] [ -o | -O ] [ --stream ] ( expression | -f <file> | --socket-repl [host:]port )
|
||||||
Usage: bb [ --help ] | [ --version ] | [ -i | -I ] [ -o | -O ] [ --stream ] ( expression | -f <file> )
|
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
--help: print this help text.
|
--help, -h or -?: print this help text.
|
||||||
--version: print the current version of babashka.
|
--version: print the current version of babashka.
|
||||||
|
|
||||||
-i: bind *in* to a lazy seq of lines from stdin.
|
-i: bind *in* to a lazy seq of lines from stdin.
|
||||||
|
|
@ -110,6 +109,7 @@ Options:
|
||||||
-O: write EDN values to stdout.
|
-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.
|
--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.
|
--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.
|
--time: print execution time before exiting.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
(if-let [opt (first options)]
|
(if-let [opt (first options)]
|
||||||
(case opt
|
(case opt
|
||||||
("--version") {:version true}
|
("--version") {:version true}
|
||||||
("--help") {:help? true}
|
("--help" "-h" "-?") {:help? true}
|
||||||
("--stream") (recur (rest options)
|
("--stream") (recur (rest options)
|
||||||
(assoc opts-map
|
(assoc opts-map
|
||||||
:stream? true))
|
:stream? true))
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
(println)
|
(println)
|
||||||
(println "Options:")
|
(println "Options:")
|
||||||
(println "
|
(println "
|
||||||
--help: print this help text.
|
--help, -h or -?: print this help text.
|
||||||
--version: print the current version of babashka.
|
--version: print the current version of babashka.
|
||||||
|
|
||||||
-i: bind *in* to a lazy seq of lines from stdin.
|
-i: bind *in* to a lazy seq of lines from stdin.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue