https://github.com/federicoponzi/lesser
Lesser: a CLI based text reader
https://github.com/federicoponzi/lesser
Last synced: 11 months ago
JSON representation
Lesser: a CLI based text reader
- Host: GitHub
- URL: https://github.com/federicoponzi/lesser
- Owner: FedericoPonzi
- Created: 2019-11-17T13:51:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T18:30:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-24T07:48:59.487Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 107 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lesser 
A simple text reader, with less functionalities then less.
## Usage:
Build it with:
```bash
cargo build --release
```
Then you can use:
```
# Read a file:
lesser /path/to/filename
# help:
lesser --help
# Pipe a file:
cat file | lesser
```
### Commands:
* h: move left one column
* l: move right one column
* j: move down one row
* k: move up one row
* Down arrow: Move down one page
* Up arrow: Move up one page
* Left arrow: Move left one page
* Right arrow: Move right one page.
* Ctrl + C, q: Exit.
---
You can also run it with cargo using:
```
cargo run -- /path/to/filename
```
### Development
For enabling logging you can use the LESSER_LOG env variable, for instance:
```
LESSER_LOG=DEBUG cargo run -- /path/to/filename 2> /tmp/lesser.stderr
```
I would suggest to redirect stderr (or stdout) to a different output, otherwise the content of the file will clash with the printed log line.
## TODO:
* Ignore the new line at the end of the file (if there is any).
* If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.
* Smarter Tab handling (now they're just filtered out).
* Implement more less's [functionalities](https://en.wikipedia.org/wiki/Less_(Unix)#Frequently_used_commands).