<commit_before># Piccolo CLI Library

This is a lightweight and friendly library to add a command line interface to
a Java program. Just provide one or more "handler" classes with public methods
annotated with `@Command` and the library will allow users to call them from
the console.

## Basic Usage

Create a `DemoHandler` class as below:

```Java
public class DemoHandler {

	@Command
	public static void hello() {

		System.out.println("Hello World!");

	}

}
```

Pass an instance of `DemoHandler` to a `Console` object:

```Java

package net.xprova.piccolo;

public static void main(String[] args) {

	Console c = new Console().addHandler(new DemoHandler());

	c.run();

}
```

This will generate the following console:

```
______  _                     _
| ___ \(_)                   | |
| |_/ / _   ___   ___   ___  | |  ___
|  __/ | | / __| / __| / _ \ | | / _ \
| |    | || (__ | (__ | (_) || || (_) |
\_|    |_| \___| \___| \___/ |_| \___/


Type :l for a list of available commands or :q to quit

>> :l
There are 3 available commands:
:list (aliases: :l)
:quit (aliases: :q)
hello

>> hello
Hello World!

>>
```

(:l is an internal command used to list available commands.)

## Command Arguments

Haskell-style arguments can be added after the command name, for example:

```Java
@Command
public void add(int a, int b) {

	System.out.printf("%d + %d = %d\n", a, b, a + b);<commit_msg>Fix minor mistake in README<commit_after># Piccolo CLI Library

This is a lightweight and friendly library to add a command line interface to
a Java program. Just provide one or more "handler" classes with public methods
annotated with `@Command` and the library will allow users to call them from
the console.

## Basic Usage

Create a `DemoHandler` class as below:

```Java
public class DemoHandler {

	@Command
	public void hello() {

		System.out.println("Hello World!");

	}

}
```

Pass an instance of `DemoHandler` to a `Console` object:

```Java

package net.xprova.piccolo;

public static void main(String[] args) {

	Console c = new Console().addHandler(new DemoHandler());

	c.run();

}
```

This will generate the following console:

```
______  _                     _
| ___ \(_)                   | |
| |_/ / _   ___   ___   ___  | |  ___
|  __/ | | / __| / __| / _ \ | | / _ \
| |    | || (__ | (__ | (_) || || (_) |
\_|    |_| \___| \___| \___/ |_| \___/


Type :l for a list of available commands or :q to quit

>> :l
There are 3 available commands:
:list (aliases: :l)
:quit (aliases: :q)
hello

>> hello
Hello World!

>>
```

(`:l` is an internal command used to list available commands.)

## Command Arguments

Haskell-style arguments can be added after the command name, for example:

```Java
@Command
public void add(int a, int b) {

	System.out.printf("%d + %d = %d\n", a, b, a + b);
{'fraction_non_alphanumeric': 0.13628255440599357, 'fraction_numerical': 0.0007135212272565109, 'mean_word_length': 2.9604519774011298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '1128753', 'n_tokens_mistral': 963, 'n_tokens_neox': 910, 'n_words': 322}