Skip to content

Commit 2f39b2c

Browse files
committed
[#8] Fix SHA in doc + example
1 parent df647fb commit 2f39b2c

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ An _extremely_ tiny and simple wrapper around the awesome [gum](https://github.c
88
This is intended for [babashka](https://babashka.org/) and JVM clojure and provides an idiomatic and data driven wrapper around the CLI tool.
99

1010
## Requirements
11+
1112
- Gum should be [installed](https://github.com/charmbracelet/gum#installation)
1213
- Babashka or the Clojure JVM runtime, latest recommended
1314

1415
## Usage
1516

1617
Add this to your `bb.edn` or `deps.edn`:
18+
1719
```edn
18-
{:deps {io.github.lispyclouds/bblgum {:git/sha "28efb3ce4c71738d0c3c9bdd965a291c5d3e7465"}}}
20+
{:deps {io.github.lispyclouds/bblgum {:git/sha "df647fb50f32e05b26e46e58d7249b4798e469e6"}}}
1921
```
2022

2123
Sample babashka usage:
24+
2225
```console
23-
$ bb -Sdeps '{:deps {io.github.lispyclouds/bblgum {:git/sha "28efb3ce4c71738d0c3c9bdd965a291c5d3e7465"}}}' \
24-
-e "(require '[bblgum.core :as b]) (b/gum :input :placeholder \"User name:\")"
26+
bb -Sdeps '{:deps {io.github.lispyclouds/bblgum {:git/sha "df647fb50f32e05b26e46e58d7249b4798e469e6"}}}' \
27+
-e "(require '[bblgum.core :as b]) (b/gum :input :placeholder \"User name:\")"
2528
```
2629

2730
## Interaction
@@ -32,6 +35,7 @@ Run `gum <cmd> --help` to discover all the params and args.
3235
This lib only has _one_ public fn: `bblgum.core/gum`.
3336

3437
## Standard Usage
38+
3539
`gum` tries to closely mimic the usage of the CLI tool, so it works like `(gum :COMMAND)`,
3640
`(gum :COMMAND [ARGS])` or `(gum :COMMAND [ARGS] :OPTION VALUE :OPTION2 VALUE)`
3741

@@ -40,6 +44,7 @@ This lib only has _one_ public fn: `bblgum.core/gum`.
4044
```
4145

4246
Examples:
47+
4348
```clojure
4449
;; Command only:
4550
(b/gum :file)
@@ -66,25 +71,29 @@ To pass flags like `--directory` use `:directory true`. **Always use full names
6671
**Note**: In the event of a name collision with a special opt and a command opt, use the [low level API](https://github.com/lispyclouds/bblgum#low-level-api).
6772

6873
Example with special options:
74+
6975
```clojure
7076
(gum :table :in (clojure.java.io/input-stream f) :height 10)
7177
```
7278

7379
### Usage Examples
7480

7581
#### input
82+
7683
```clojure
7784
(b/gum :choose ["foo" "bar" "baz"] :no-limit true)
7885

7986
{:status 0 :result ("foo" "baz")}
8087
```
8188

8289
#### write
90+
8391
```clojure
8492
(b/gum :write)
8593
```
8694

8795
#### filter
96+
8897
```clojure
8998
(b/gum :filter :in (clojure.java.io/input-stream "flavours.txt"))
9099

@@ -132,14 +141,16 @@ All of the rest of the options and usecases _should work_ ™. Please raise issu
132141

133142
- Since this uses gum which expects an interactive TTY like terminal, this is not possible to be used from editor REPLs like Conjure, CIDER, Calva etc **when jacked-in**.
134143
To use this from an editor REPL:
135-
- First start the REPL in a terminal, for example in bb for nREPL on port 1667: `bb nrepl-server 1667`.
136-
- Connect to the port from the editor of your choice, for example with neovim and conjure: `:ConjureConnect 1667`.
137-
- Perform the usual REPL interactions and all the gum output would appear on the terminal and not your editor but the result should be on the editor as expected.
144+
- First start the REPL in a terminal, for example in bb for nREPL on port 1667: `bb nrepl-server 1667`.
145+
- Connect to the port from the editor of your choice, for example with neovim and conjure: `:ConjureConnect 1667`.
146+
- Perform the usual REPL interactions and all the gum output would appear on the terminal and not your editor but the result should be on the editor as expected.
138147

139148
## Low-level API
149+
140150
This was standard in previous versions of gum, we kept it for full backward compatibility.
141151

142152
Convention:
153+
143154
- The main command should be passed as a keyword or string to `:cmd`. Required
144155
- Passing opts:
145156
- The --opts are to be passed as `:opts`
@@ -159,7 +170,6 @@ Convention:
159170
The `gum` fn returns a map of exit status of calling gum and the result either as a seq of lines or coerced via `:as`.
160171
Exceptions are not thrown unless calling gum itself does, the status code is intended for programming for failures.
161172

162-
163173
```clojure
164174
(b/gum {:cmd :choose
165175
:opts {:no-limit true}
@@ -168,7 +178,6 @@ Exceptions are not thrown unless calling gum itself does, the status code is int
168178
{:status 0 :result ("foo" "baz")}
169179
```
170180

171-
172181
## License
173182

174183
Copyright © 2023- Rahul De.

0 commit comments

Comments
 (0)