/lesser

Lesser: a CLI based text reader

Primary LanguageRust

lesser CI

A simple text reader, with lesser functionalities then less.

Usage:

Build it with:

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 showing logs:

LESSER_LOG=DEBUG cargo run -- /path/to/filename 2> /tmp/lesser.stderr

You need to redirect stderr to some file, otherwise the content of the file will override 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.
  • Implement more less's functionalities.