An unholy blend of grep, sed, awk, and Python.
Project description
This is my text munging tool. There are many like it, but this one is mine.
linesieve is an unholy blend of grep
, sed
, awk
, and Python,
with very specific features, born out of spite.
Features
- line-oriented
- section-oriented
- show only matching sections
- show the failing section
- match/sub with the full power of re
- chain filters into pipelines
- colors!
- TODO: specific filters
Examples
Get all options used by any git command
Note that some of the man pages contain multiple OPTIONS sections (e.g. ADVANCED OPTIONS).
export MANWIDTH=9999
function man-section {
col -b | linesieve -s '^[A-Z ()-]+$' show "$@"
}
man git \
| man-section COMMANDS match -o '^ +(git-\w+)' \
| cat - <( echo git ) \
| sort | uniq \
| xargs -n1 man \
| man-section OPTIONS match -o '^ +(-.*)' \
sub -F -- '--[no-]' '--' \
sub -F -- '--no-' '--' \
| sort -dfu
Output:
-/ <path>
-, --stdin
-0
...
-a, --all
-A, --all, --ignore-removal
-a, --annotate
...
--autosquash, --autosquash
--autostash, --autostash
-b
-b, --branch
...
TODO: Ant output
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
linesieve-1.0a8.tar.gz
(20.0 kB
view hashes)
Built Distribution
linesieve-1.0a8-py3-none-any.whl
(14.4 kB
view hashes)
Close
Hashes for linesieve-1.0a8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0f65b9eb1450d63006ffaaf656f56b3c86639557d3e3688f069bbf96a499981 |
|
MD5 | 0582dd6ff60f8ae1f90cfe4faa8a8822 |
|
BLAKE2b-256 | fc5c0cacccc6e9f6caf1fb2cddccd2d6e441cf14e2d9130dcbbb1a2dfd5d5b58 |