# console-autocompletion

> A helper tool to auto complete command

Latest version **0.0.2** (published 2020-01-11) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install console-autocompletion
pnpm add console-autocompletion
yarn add console-autocompletion
bun add console-autocompletion
```

Provides the commands `console-autocompletion`, `console-autocompletion-installer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-01-11 |
| First published | 2020-01-11 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Wonyong Kim |
| Maintainers | chokobole |
| Keywords | console, complete, completion, tab, terminal, unix |

## Links

- npm: https://www.npmjs.com/package/console-autocompletion
- Repository: https://github.com/chokobole/console-autocompletion
- Homepage: https://github.com/chokobole/console-autocompletion#readme
- Issues: https://github.com/chokobole/console-autocompletion/issues
- npm.io page: https://npm.io/package/console-autocompletion

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-01-11
- 0.0.1 — 2020-01-11

## README

# Console Autocompletion

This is a sub project for c++ flag parser [console](https://github.com/chokobole/console). But it can be used for general purpose.

## How to use

* Install the package.

```bash
npm install -g console-autocompletion
```

* Prepare json file describing your flgas.

```json
[
  {
    "shortName": "-n1",
    "longName": "--number1",
    "needsValue": true
  },
  {
    "shortName": "-n2",
    "longName": "--number2",
    "needsValue": true
  }
]
```

* Copy to `~/.console-autocompletion/`.

```bash
cp /path/to/json ~/.console-autocompletion/
```

* Generate `bash_completion` and activate it.

```bash
console-autocompletion-installer program_name /path/to/bash_completion
source /path/to/bash_completion
```

## Flag

* `name`: name of the flag, if `name` is set, `shortName` or `longName` should not be set. At this locaiton, value should be come. It means it's a positional flag.
* `shortName`: '-' prefixed name, if `shortName` is set, `name` should not be set. It means it's an optional flag.
* `longName`: '--' prefixed name, if `longName` is set, `name` should not be set. It means it's an optional flag.
* `needsValue`: If it is set to **true**, this optional flag should be followed by value.
* `isSequential`: If it is set to **true**, this optional flag can be come multiple times.
* `subFlags`: If it is set, after this positional flag, the subarray will be parsed.

---
_Source: https://npm.io/package/console-autocompletion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
