File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,17 @@ assert [ ${#REPLY[@]} -eq 4 ]
45
45
46
46
bobject get-string --value root_object ' .["zulu"].["yankee"].["xray"].["foxtrot"].[2]'
47
47
assert [ " $REPLY " = rho ]
48
+
49
+ bobject.print ' root_object'
50
+ # |__ zulu (__bash_object_root_object___zulu_24092_8313_29963_14301_14535)
51
+ # |__ yankee (__bash_object_root_object___zulu_yankee_15383_14163_12814_23488_13779)
52
+ # |__ xray (__bash_object_root_object___zulu_yankee_xray_18071_28791_7790_539_19231)
53
+ # |__ whiskey
54
+ # |__ foxtrot (__bash_object_root_object___zulu_yankee_xray_foxtrot_26606_15833_10655_7208_16587)
55
+ # |- omicron
56
+ # |- pi
57
+ # |- rho
58
+ # |- sigma
48
59
```
49
60
50
61
## Installation
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = ' '
3
+ slug = ' '
4
+ version = ' '
5
+ authors = []
6
+ description = ' '
7
+
8
+ [run ]
9
+ dependencies = [' https://github.com/hyperupcall/bash-object.git@7936badc984fc56c1aa7e2c940e5e382923146d7' ]
10
+ sourceDirs = []
11
+ builtinDirs = []
12
+ binDirs = []
13
+ completionDirs = []
14
+ manDirs = []
15
+
16
+ [run .shellEnvironment ]
17
+
18
+ [run .setOptions ]
19
+
20
+ [run .shoptOptions ]
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -eo pipefail
3
+
4
+ # Necessary for Basalt to load dependencies
5
+ eval " $( basalt-package-init) "
6
+ basalt.package-init
7
+ basalt.package-load
8
+
9
+
10
+ declare -A root_object=()
11
+ declare -A zulu_object=()
12
+ declare -A yankee_object=()
13
+ declare -A xray_object=([whiskey]=victor)
14
+ declare -a foxtrot_array=(omicron pi rho sigma)
15
+
16
+ bobject set-object --ref root_object ' .zulu' zulu_object
17
+ bobject set-object --ref root_object ' .zulu.yankee' yankee_object
18
+ bobject set-object --ref root_object ' .zulu.yankee.xray' xray_object
19
+ bobject set-array --ref root_object ' .zulu.yankee.xray.foxtrot' foxtrot_array
20
+
21
+ bobject get-object --value root_object ' .zulu.yankee.xray'
22
+ printf ' %s - %s\n' " ${REPLY[whiskey]} " victor
23
+
24
+ bobject get-string --value root_object ' .zulu.yankee.xray.whiskey'
25
+ printf ' %s - %s\n' " $REPLY " victor
26
+
27
+ bobject get-array --value root_object ' .zulu.yankee.xray.foxtrot'
28
+ printf ' %d - %d\n' ${# REPLY[@]} 4
29
+
30
+ bobject get-string --value root_object ' .["zulu"].["yankee"].["xray"].["foxtrot"].[2]'
31
+ printf ' %s - %s\n' " $REPLY " rho
32
+
33
+ bobject.print ' root_object'
You can’t perform that action at this time.
0 commit comments