diff options
author | Shav Kinderlehrer <[email protected]> | 2023-04-22 15:33:08 -0400 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2023-04-22 15:33:08 -0400 |
commit | d1bbadfbd69b12d107f108773d22c3a80f646829 (patch) | |
tree | b2ec483cce2e93f902e2cadc67740a88f18cb6f0 /README.md | |
parent | 69cf5566cf894fba541f6da4361f56f4ecdc0094 (diff) | |
download | lat-d1bbadfbd69b12d107f108773d22c3a80f646829.tar.gz lat-d1bbadfbd69b12d107f108773d22c3a80f646829.zip |
Update README
- QOL for *.tape files
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 68 |
1 files changed, 29 insertions, 39 deletions
@@ -54,7 +54,7 @@ make ## Use -`lat` can, for the most part, be a direct drop in for `cat`. However it really shines when embedded into another program. For example, in `fzf`, `lat` makes an excellent viewer with the command `fzf --command lat -l {}`. +`lat` can, for the most part, be a direct drop in for `cat`. However it really shines when embedded into another program. For example, in `fzf`, `lat` makes an excellent viewer with the command `fzf --command lat -r {}`.  @@ -64,7 +64,7 @@ For example, this should be possible in a future version of `lat` ```c int main(void) { - FILE *st = popen("lat -l", "w"); + FILE *st = popen("lat -r", "w"); if (st == NULL) exit(1); @@ -77,37 +77,43 @@ int main(void) { ### Features and Flags -#### `--color` +#### `-c` color Completely disables or enables all colored output from `lat`. ##### Example  -> `lat` also respects [NO_COLOR](https://no-color.org/), but `--color` overrides it +> `lat` also respects [NO_COLOR](https://no-color.org/), but `-c` overrides it -#### `--lines` +#### `-l` line numbers Print numbers for each line of the file. ##### Example  -#### `--headers` +#### `-t` file title Shows or hides formatted file data headers. ##### Example  -#### `--binary` +#### `-b` binary mode By default, `lat` will attempt to detect if the file is printable or not. If the file isn't (e.g. you ran `lat file.pdf`) then lat will enter *`binary mode`*. In *`binary mode`*, `lat` will skip a lot of processing in favor of speed. You can force *`binary mode`* to be `on` or `off` with the flags `-b` and `-bb` respectively. ##### Example  -#### `--literal` -`lat` is smart enough to print all non-file characters to a separate filestream. That way, the output of `lat` can be used to con**cat**enate files, the way it was originally meant to be. +#### `-r` raw output +`lat` is smart enough to print all non-file characters to a separate filestream. That way, the output of `lat` can be used to con**cat**enate files, the way it was originally meant to be (with `>` or `|`). However, sometimes you want those extra symbols. -`--literal` prints everything out to the primary filestream (usually `stdout`) +`-r` prints everything out to the primary filestream (usually `stdout`) ##### Example - + -#### `--pager` +#### `-p` pager `lat` comes with out-of-the-box support for paging in `less`. If you don't want your file messing up your terminal, just `-p` it. + +### `-n` name +`lat` allows you to customize the name of the file shown. This can be useful in demonstrations or when `lat` is embedded in another program. +#### Example + + ##### Example  @@ -115,42 +121,26 @@ However, sometimes you want those extra symbols. ## Helptext -> `lat --help` +> `lat -h` ```text lat | lazy cat - a cat clone with some quality-of-life embellishments -usage: lat [-cntblpVh] [file...] +usage: lat [-cltbrpnVh] [file...] options: - -c, --color toggle color - -n, --lines toggle line numbers - -t, --headers toggle file info headers - -b, --binary toggle binary mode, -b forces binary and -bb forces NOT binary - -l, --literal print everything to stdout (or equivalent) - -p, --pager print file with the pager (uses less) - -V, --version show program version - -h, --help display this help text (--help shows additional info) + -c toggle color + -l toggle line numbers + -t toggle file info headers + -b toggle binary mode, -b forces binary and -bb forces NOT binary + -r print everything to stdout (or equivalent) + -p print file with the pager (uses less) + -n set the name of the file in the title + -V show program version + -h display this help text environment: NO_COLOR, see https://no-color.org/ - -examples: -lat file1 - print the contents of file1 with the default formatting -lat - file1 - read from stdin (the '-' flag reads from stdin) and then print the contents of stdin and file1 -lat -nc file1 file2 - print the contents of file1 and file2 without printing line numbers or colors -lat --binary file.txt - force file.txt to be treated as a binary file -lat -bb --pager file.txt - force file.txt to NOT be treated as a binary file and print it in the pager -curl example.com | lat - pipe the results of 'curl example.com' into lat -fzf --preview 'lat -l {}' - use lat as the file viewer in fzf - ``` |