Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonots/rust-lltsv
Rust fork of sonots/lltsv, which is a CLI tool to list specified keys of LTSV (Labeled Tab Separated Values)
https://github.com/sonots/rust-lltsv
Last synced: 2 days ago
JSON representation
Rust fork of sonots/lltsv, which is a CLI tool to list specified keys of LTSV (Labeled Tab Separated Values)
- Host: GitHub
- URL: https://github.com/sonots/rust-lltsv
- Owner: sonots
- License: mit
- Created: 2024-01-06T12:04:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T03:15:29.000Z (about 1 year ago)
- Last Synced: 2025-01-11T14:16:32.898Z (9 days ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# lltsv
A CLI tool to list specified keys of LTSV (Labeled Tab Separated Values)
# Description
`lltsv` is a command line tool written in golang to list specified keys of LTSV (Labeled Tab Separated Values) text.
Example 1:
```bash
$ echo "foo:aaa\tbar:bbb\tbaz:ccc" | lltsv -k foo,bar
foo:aaa bar:bbb
```The output is colorized as default when you outputs to a terminal.
The coloring is disabled if you pipe or redirect outputs.Example 2:
```bash
$ echo "foo:aaa\tbar:bbb\tbaz:ccc" | lltsv -k foo,bar -K
aaa bbb
```Eliminate labels with `-K` option.
Example 3:
```bash
$ lltsv -k foo,bar -K file*.log
```Specify input files as arguments.
**How Useful?**
LTSV format is not `awk` friendly (I think), but `lltsv` can help it:
```bash
$ echo -e "time:2014-08-13T14:10:10Z\tstatus:200\ntime:2014-08-13T14:10:12Z\tstatus:500" \
| lltsv -k time,status -K | awk '$2 == 500'
2014-08-13T14:10:12Z 500
```Useful!
## Usage
```
$ lltsv -h
lltsv - List specified keys of LTSV (Labeled Tab Separated Values)Usage: lltsv [OPTIONS] [FILENAME]...
Arguments:
[FILENAME]... Set the input file(s)Options:
-k, --key keys to output (multiple keys separated by ,)
-K, --no-key output without keys (and without color)
-i, --ignore-key ignored keys to output (multiple keys separated by ,)
-h, --help Print help
-V, --version Print version
```## ToDo
1. write tests
## Build
To build, use `cargo build`
```
$ git clone [email protected]:sonots/rust-lltsv
$ cd rust-lltsv
$ cargo build
```## Contribution
1. Fork (https://github.com/sonots/rust-lltsv/fork)
2. Create a feature branch
3. Commit your changes
4. Rebase your local changes against the master branch
7. Create new Pull Request## Copyright
See [LICENSE](./LICENSE)