https://github.com/maimere/gawk-less-clone
A minimal less clone implemented in GNU AWK.
https://github.com/maimere/gawk-less-clone
awk command-line-tool gnu-awk less text-viewer
Last synced: 6 months ago
JSON representation
A minimal less clone implemented in GNU AWK.
- Host: GitHub
- URL: https://github.com/maimere/gawk-less-clone
- Owner: maimere
- License: wtfpl
- Created: 2025-03-08T16:56:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-19T12:46:48.000Z (about 1 year ago)
- Last Synced: 2025-03-19T13:40:55.023Z (about 1 year ago)
- Topics: awk, command-line-tool, gnu-awk, less, text-viewer
- Language: Awk
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# One more less, now using GNU AWK
This is a very simple clone of GNU `less`, written in GNU AWK programming language.
### Dependencies
- GNU AWK 4.0+
- ncurses
- coreutils
## What it does
- Read a file calling it as an argument: `./less-clone.gawk `
- If no argument is given, the program will ask for the filename.
- `h`/`j`/`k`/`l` and arrow keys to scroll on every direction.
- `b`/`f` to scroll one page up or down.
- `q` to quit.
## Yet to be done
- [x] Properly change the status line.
- [x] Command option (:) is still useless. Not fully implemented. Maybe remove it for good. [removed]
- [x] Handle invalid filename
- [x] Simplify change of terminal properties with stty and tput. It is too hard coded now.
- [x] Handle long lines. Now they are capped by the number of columns of the terminal. [added horizontal scrolling]
- [x] On function get_input: substitute if-elses for the `switch` statement.
- [ ] Add functions to treat redundant parts.
- [ ] Handle large lines by wrapping, which is the default `less` behaviour.
- [ ] Add command to open another file.
- [ ] Add help command, focusing on a lean status line.