https://github.com/berquerant/lisel
Select lines from target by index
https://github.com/berquerant/lisel
rust
Last synced: about 1 year ago
JSON representation
Select lines from target by index
- Host: GitHub
- URL: https://github.com/berquerant/lisel
- Owner: berquerant
- Created: 2024-05-14T14:47:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T14:59:55.000Z (about 1 year ago)
- Last Synced: 2025-04-21T15:43:12.823Z (about 1 year ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lisel
```
❯ lisel --help
Select lines from target by index
Usage: lisel [OPTIONS] [FILE]...
Arguments:
[FILE]...
Target filenames, accepts one (INDEX) or two filenames (INDEX and TARGET).
2 files:
The first file is INDEX, the second is TARGET.
1 file:
The file is INDEX, stdin is TARGET.
Options:
-s, --swap-file-role
Swap file role: INDEX and TARGET
-e, --index-regex
Regular expression to determine whether the index of the row exists.
When a certain line in INDEX matches, output the TARGET line corresponding to that line number.
Default: .+
-v, --index-invert-match
Reverse lines to output and lines not to output
-n, --index-line-number
Use line number index.
Instead of selecting rows from INDEX with regular expression, use a line in the following format as index.
LINE_NUMBER
selects line LINE_NUMBER of TARGET.
LINE_START,LINE_END
selects lines LINE_START to LINE_END (LINE_START <= LINE_END) of TARGET.
LINE_START,
selects lines LINE_START of TARGET to the end of TARGET.
,LINE_END
selects lines the beginning of TARGET to LINE_END of TARGET.
LINE_NUMBER and LINE_START are greater than the LINE_NUMBER and LINE_END of previous lines in the INDEX file.
Debug logging can be enabled via RUST_LOG in env_logger https://crates.io/crates/env_logger.
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```