2020-11-13 22:36:17 +01:00
|
|
|
# cq usage
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cq < file.cbor
|
|
|
|
cq [attribute] < file.cbor
|
|
|
|
```
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cq ".people.alice.age" < file.cbor
|
|
|
|
```
|
|
|
|
|
|
|
|
# json-to-cbor usage
|
|
|
|
|
|
|
|
```sh
|
|
|
|
json-to-cbor < file.json > file.cbor
|
|
|
|
```
|
|
|
|
|
2020-11-26 16:06:58 +01:00
|
|
|
# hs usage
|
|
|
|
|
|
|
|
`hs` stands for `hexstring`.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
hs < file.cbor
|
|
|
|
```
|
|
|
|
|
2020-11-30 04:55:15 +01:00
|
|
|
# string-keys-to-int usage
|
|
|
|
|
|
|
|
JSON format has a limitation on the type of hash keys: it has to be a string.
|
|
|
|
CBOR doesn't come with such limitation.
|
|
|
|
`string-keys-to-int` automatically converts string keys into integers, whenever all the keys in a hash can be converted.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
string-keys-to-int < file.cbor
|
|
|
|
```
|
|
|
|
|