An open API service indexing awesome lists of open source software.

https://github.com/mle86/hi

Highlights lines that contain keywords.
https://github.com/mle86/hi

ansi-colors c command-line-tool grep-like highlight keyword-detection linux

Last synced: 3 months ago
JSON representation

Highlights lines that contain keywords.

Awesome Lists containing this project

README

          

[//]: # (This file was autogenerated from the man page with 'make README.md')

# hi(1) - highlights lines containing keywords

[![Build Status](https://travis-ci.org/mle86/hi.svg?branch=master)](https://travis-ci.org/mle86/hi)
[![GPLv3 License](https://img.shields.io/badge/license-GPL%20v3-498e7f.svg?style=flat)](/COPYING)

Version 2.1.0, February 2019

hi [-l|-w|-p] [OPTIONS] [--] KEYWORD...

hi -L [OPTIONS] [--] RANGE...

# Description

**hi** reads text from the standard input
and prints its input on the standard output.
Lines containing at least one of the given keywords
will be colorized
with ANSI escape codes.

# Installation

```
$ make
# make install
```

This will compile the binary and copy it to /usr/local/bin/**hi**.
The man page will be copied to /usr/local/share/man/man.1/**hi.1.gz**.

# Modes

The program operates in one of several
**output modes.**
The default output mode is **-l**.

* **-l, --lines**
Highlight lines:
All lines containing at least one of the *KEYWORD*s
will be highlighted in the output.
* **-p, --paragraphs**
Highlight paragraphs:
All paragraphs containing at least one of the *KEYWORD*s
will be highlighted in the output.
* **-w, --words**
Highlight words:
Only the *KEYWORD*s themselves
will be colorized in the output.
* **-L, --explicit, --ranges**
Explicit mode:
In this mode, there are no *KEYWORD*s.
Instead,
the program takes one or more line number *RANGE*s
which will be colorized.
For example, the invocation
“**hi -L 3 8-10 5**”
will highlight lines 3, 5, 8, 9, and 10
but nothing else.
Line numbers start at 1.

# Options

* **-i**, **--ignore-case**
Enable case-insensitive matching.
This is the default.
Note that the program is unaware of locales
and can only compare plain ASCII letters (**A**..**Z**)
case-insensitively; all other characters will be compared byte-for-byte.
* **-I**, **--case-sensitive**
Enable case-sensitive matching.
The opposite of **-i**.
* **-c**, **--color** *COLOR*
Select the output highlighting color.
Recognized colors are:
* **yellow**/**ye**/**yw**
(default),
* **red**/**re**/**rd**,
* **blue**/**bl**,
* **green**/**gr**/**gn**,
* **cyan**/**cy**/**cn**,
* **white**/**wh**.
* **-h**, **--help**
Show program help.
* **-V**, **--version**
Show program version information.

# License

This program is released under the
[GPLv3 license](https://www.gnu.org/licenses/gpl.html).

It includes the "nstr" module
from the
[csv-parser project](https://github.com/mle86/csv-parser)
which is released under the
[MIT license](https://opensource.org/licenses/MIT).

# Author

Maximilian Eul <[maximilian@eul.cc](mailto:maximilian@eul.cc)>
(https://github.com/mle86)