Skip to content

Commit 537f9c8

Browse files
committed
docs: update examples/jb-cli.sh to reflect API changes
API hasn't changed recently, but this example was not updated with the last round of changes.
1 parent ee1c6be commit 537f9c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/jb-cli.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ Example: json.org https://json.org/example.html
3131
EOT
3232
printf "\njson.bash jb CLI:\n"
3333

34-
# jb's @=/file references combined with shell process substitution allow jb
34+
# jb's @/file references combined with shell process substitution allow jb
3535
# calls to nest:
36-
jb menu:json@=<(
37-
jb id=file value=File popup:json@=<(
38-
jb menuitem:json[]@=<(
36+
jb menu:json@<(
37+
jb id=file value=File popup:json@<(
38+
jb menuitem:json[]@<(
3939
jb value=New onclick="CreateNewDoc()"; \
4040
jb value=Open onclick="OpenDoc()"; \
4141
jb value=Close onclick="CloseDoc()"
@@ -46,7 +46,7 @@ jb menu:json@=<(
4646
# Or nest jb calls with command substitution
4747
jb menu:json="$(
4848
jb id=file value=File popup:json="$(
49-
jb menuitem:json[]="$(
49+
jb menuitem:json[$'\n']="$(
5050
jb value=New onclick="CreateNewDoc()"; \
5151
jb value=Open onclick="OpenDoc()"; \
5252
jb value=Close onclick="CloseDoc()"
@@ -62,7 +62,7 @@ export menuitems=$(
6262
)
6363
# Or temporary files
6464
tmp=$(mktemp -d)
65-
jb menuitem:json[]@=menuitems > "${tmp:?}/popup" # the filename is used as the key
65+
jb menuitem:json[$'\n']@menuitems > "${tmp:?}/popup" # the filename is used as the key
6666
export menu=$(jb id=file value=File @"${tmp:?}"/popup:json)
6767
# Environment variables can be explicitly passed without exporting globally
6868
menu=${menu:?} jb @menu:json
@@ -92,9 +92,9 @@ Example: https://datatracker.ietf.org/doc/html/rfc8259#section-13
9292
EOT
9393
printf "\njson.bash jb CLI:\n"
9494

95-
jb Image:json@=<(
95+
jb Image:json@<(
9696
jb Width:number=800 Height:number=600 Title="View from 15th Floor" \
97-
Thumbnail:json@=<(
97+
Thumbnail:json@<(
9898
jb url="http://www.example.com/image/481989943" height:number=125 \
9999
width:number=100
100100
) \

0 commit comments

Comments
 (0)