Skip to content

Commit

Permalink
add todo and tips in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmet2mir committed May 28, 2020
1 parent 6f30fdf commit 2a1b2b8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ deploy:
password:
secure: "zoklW1G25tsz1TCIXThHyUpQh6x72DpmrxW4dCPp4Nw1eNuPgtr3V374bo980OLupf+XKcoCAjVA6i6JP2dhrkLrw4vdbZo6+KERsrRczfhdvfXJ+rQ4gA0ODMMhXKISKmLSoB4QWCDk7z5af0mccHB5HvNOebnCTOH46F5TMoVvIHduu5I9VNy+8ZMvL5mjYtyok/+sryl5LfBgIwfcc4ZQiBX/zmj1iE37jwfG+e6NH1QWmy/MwHVmK58UkER6O5U9TV7rbbn/zyYw9Kov+Tmg8fFfJ2x8WytewEIfpF7XWuH5cMm/0t4q5o2OzBj9TP/aFCp5+JR5C7TgAboRb22aYD5HJLCE67r2uHiY0F0X3hBmacdI5gHoA72InVejHlArnXYEsrio1joTMw3uCuy5oVDMRTefku/kjLhE9q+Agx3lXhjnzvzPBiURDf7yWkoO7ede9XCTcDWWQk1WXZPHW3U+BbiucVJoLnfUiFdAX1xDVsUaSyYFjZsS1xhogA9Lh8S2IRuojkNuKG7uvhoI3pzyx7r50WDrDnvofRVZ8rz7txrNn3VhjUA4X/v8AfuM2q64Cy83eR7OzjPk5mNrbQ6U5TFUA6M12wnz+HwyQBnXWLFBo6xbIzDySPCb99ZdmZwvaIF8fJ3TXYFIkahURW8P3ZJK1caGS1gkkGo="
on:
python: 3.6
tags: true
distributions: "bdist_wheel"
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pip install wildq
wildq [--yaml|--json|--toml|--ini|--xml|--hcl> <jq filter> [file]
```

There is also a shorter command `wq` comming with the package.

Output is similar to `jq -MCr` (no color, no compact and no quote on single value)

Like `jq cli`, wildq supports both of stdin and file to the function
Expand Down Expand Up @@ -72,6 +74,18 @@ wildq --json ".keys[]" examples/json.json
}
alone
```
or

```sh
wq --json ".keys[]" examples/json.json
{
"key": "value1"
}
{
"key": "value2"
}
alone
```

For TOML
```sh
Expand Down Expand Up @@ -140,6 +154,25 @@ cat examples/hcl.hcl | wildq --hcl ".keys[]"
}
```

## Tips and tricks

Loop on keys in bash without creating a subshell

```sh
wildq --toml "keys[]" examples/toml.toml | while read -r key
do
echo "Getting key ${key}"
done
```

## TODO

- [ ] support all jq types
- [ ] add tests...
- [ ] add more control over filters and files
- [ ] detect automagically filetype
- [ ] use click for the CLI

## Contributing

Merge requests are welcome :)
Expand Down

0 comments on commit 2a1b2b8

Please sign in to comment.