# Building

To build il(hare) you must first install [hare](https://harelang.org) and [hare-libtui](https://git.sr.ht/~ark/hare-libtui) then run:

```
hare build -o il .
```

# Usage

To run il, simply pass a list of items to il's stdin:

```
ls | il
```

This will allow you to select items from the list using **j** and **k**, mark items using the spacebar and print them to stdout and exit using enter or **l**. The currently selected item is also the marked item if none have been marked with space. To quit without printing press **q**. To see other keybindings, refer to handlers.ha.

## Examples

This program can be used to allow you to choose items in order to pass them to another command.

For instance:

process killer:

```
ps aux | il | awk '{print $1}' | xargs kill
```

file chooser (this example displays information about the files using **file**), note that il supports a **-0** flag that prints NULL separated items instead of the default whitespace separated which is useful for items that contain spaces:

```
ls | il -0 | xargs -0 file
```

A launcher for a feed of urls (for instance from an rss feed reader):

feeds.txt with the following contents:

```
yt_channelname | Video Title: https://www.youtube.com/watch?v=0dKrUE_O0VE
peertube_channel | Insert title here: https://spacepub.space/w/1MnYGVguhGM7tuq2DUKtYQ
...
```

Then launch:

```
il < feeds.txt | awk '{print $NF}' | xargs mpv
```
