<commit_before>[![Build Status](https://secure.travis-ci.org/fraugster/cli.png?branch=master)](http://travis-ci.org/fraugster/cli)
[![Coverage Status](https://coveralls.io/repos/fraugster/cli/badge.svg?branch=master)](https://coveralls.io/r/fraugster/cli?branch=master)
[![GoDoc](https://godoc.org/github.com/fraugster/cli?status.svg)](https://godoc.org/github.com/fraugster/cli)
[![License](https://img.shields.io/github/license/fraugster/cli.svg)](https://github.com/fraugster/cli/blob/master/LICENSE)

## github.com/fraugster/cli

Package `cli` implements utility functions for running command line applications.

The following simple features are currently implemented:
- creating a `context.Context` which is closed when `SIGINT`, `SIGQUIT` or `SIGTERM` is received.
- context aware reading lines from stdin into a channel
- printing values using user a defined format (e.g. `json`, `yml` or `table`)

## Motivation

CLI applications of perform similar tasks such as handling stop signals, reading
from stdin and printing results to stdout. This package provides these functions
in a single and coherent repository. Applications built with `github.com/fraugster/cli`
treat `context.Context` as first class citizen to remain responsive and implement
graceful shutdown. Naturally this is visible when consuming (multi-line) input
from stdin.  The `cli.Print` function is especially useful since it encourages
developers to support multiple machine readable output formats which makes it easy
to pipe the results of one application into another (e.g. `my-app -o=json | jq …`).

## Installation 

```sh
$ go get github.com/fraugster/cli
```<commit_msg>Move README tags below title<commit_after>## github.com/fraugster/cli

[![Build Status](https://secure.travis-ci.org/fraugster/cli.png?branch=master)](http://travis-ci.org/fraugster/cli)
[![Coverage Status](https://coveralls.io/repos/fraugster/cli/badge.svg?branch=master)](https://coveralls.io/r/fraugster/cli?branch=master)
[![GoDoc](https://godoc.org/github.com/fraugster/cli?status.svg)](https://godoc.org/github.com/fraugster/cli)
[![License](https://img.shields.io/github/license/fraugster/cli.svg)](https://github.com/fraugster/cli/blob/master/LICENSE)

Package `cli` implements utility functions for running command line applications.

The following simple features are currently implemented:
- creating a `context.Context` which is closed when `SIGINT`, `SIGQUIT` or `SIGTERM` is received.
- context aware reading lines from stdin into a channel
- printing values using user a defined format (e.g. `json`, `yml` or `table`)

## Motivation

CLI applications of perform similar tasks such as handling stop signals, reading
from stdin and printing results to stdout. This package provides these functions
in a single and coherent repository. Applications built with `github.com/fraugster/cli`
treat `context.Context` as first class citizen to remain responsive and implement
graceful shutdown. Naturally this is visible when consuming (multi-line) input
from stdin.  The `cli.Print` function is especially useful since it encourages
developers to support multiple machine readable output formats which makes it easy
to pipe the results of one application into another (e.g. `my-app -o=json | jq …`).

## Installation 

```sh
$ go get github.com/fraugster/cli
```
{'fraction_non_alphanumeric': 0.11623005118940079, 'fraction_numerical': 0.0, 'mean_word_length': 5.279773156899811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1282265', 'n_tokens_mistral': 1018, 'n_tokens_neox': 952, 'n_words': 317}