Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sentriz/untree
like gron, but generalised on indentation
https://github.com/sentriz/untree
Last synced: 19 days ago
JSON representation
like gron, but generalised on indentation
- Host: GitHub
- URL: https://github.com/sentriz/untree
- Owner: sentriz
- License: mit
- Created: 2024-03-27T23:44:40.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-06-20T16:37:01.000Z (7 months ago)
- Last Synced: 2024-12-27T00:12:04.545Z (22 days ago)
- Language: Go
- Size: 6.84 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
untree
untree finds and flattens tree-like text, making it easily searchable. for example prefixing all expressions a codebase with their parent function definitions, all HTML tags with their parent tags, or JSON objects their parent keys names.
all that's required is indentation with spaces or tabs
(like gron, but generalised on indentation)
---
### installation
```
$ go install go.senan.xyz/untree@latest
```### usage
```
$ cmd | untree
$ untree [FILE ...]
```the output format is `\t`. suitable for grepping, piping, column selecting. eg "all Go handler functions which log under a certain condition" could be
```bash
untree "$(git ls-files "*.go")" \
| grep "func.*Handle.*if.*err :=.*slog.Info" \
| awk '{ print $2 }'`
```### examples