# completion 1.0.2

A package to add shell command completion to your Dart application




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'completion:1.0.2'
```
Published: 2025-07-17T23:04:20.696556Z
Expected archive SHA-256: 82fa09800c0b71a2e8396bf3ca6b36b43cd35fe7ba2aeab53b6349ac671d0f5b

Available in cache; verification: upstream_checksum
## Direct dependencies
- args: ^2.0.0
- logging: ^1.0.0
- path: ^1.8.0

## Package README (untrusted upstream documentation)
*Add shell command completion to your Dart console applications.*

[![Dart CI](https://github.com/kevmoo/completion.dart/actions/workflows/ci.yml/badge.svg)](https://github.com/kevmoo/completion.dart/actions/workflows/ci.yml)
[![pub package](https://img.shields.io/pub/v/completion.svg)](https://pub.dev/packages/completion)
[![package publisher](https://img.shields.io/pub/publisher/completion.svg)](https://pub.dev/packages/completion/publisher)

To use this package, instead of this:

```dart
import 'package:args/args.dart';

void main(List<String> args) {
  final argParser = ArgParser()..addFlag('option', help: 'flag help');
  // ... add more options ...
  final argResults = argParser.parse(args);
  // ...
}
```

do this:

```dart
import 'package:args/args.dart';
import 'package:completion/completion.dart' as completion;

void main(List<String> args) {
  final argParser = ArgParser()..addFlag('option', help: 'flag help');
  // ... add more options ...
  final argResults = completion.tryArgsCompletion(args, argParser);
  // ...
}
```

(The only difference is calling `complete.tryArgsCompletion` in place of `argParser.parse`)

This will add a "completion" command to your app, which the shell will use
to complete arguments.

To generate the setup script automatically, call `generateCompletionScript`
with the names of the executables that your Dart script runs as (typically
just one, but it could be more).

Also, see [the example](./example).

## Changelog
## 1.0.2

- Fix README link
- Require Dart 3.7.0

## 1.0.1

- Require Dart 2.18.0
- Update license.

## 1.0.0

- Support null safety.

## 0.2.3

* Prevent `tryCompletion` from crashing when looking up the script name when run
  without a current working directory.

## 0.2.2

* Increase minimum Dart SDK to `2.3.0`.

## 0.2.1+1

* Small fix to error handler.

## 0.2.1

* Exposed the `tryCompletion` method as a public interface.

* Added more complete instructions in the [`README.md`](README.md)

## 0.2.0

* Renamed `COMPLETION_COMMAND_NAME` to `completionCommandName`.

* Added named `logFile` argument to `tryArgsCompletion` and `tryCompletion` to
  aid debugging.

## 0.1.6

* A bunch of internal cleanup.

## 0.1.5

* Support the latest version of `logging`.

## 0.1.4

* Don't blow up if run via `pub run`.

## 0.1.2+5

* Fix for latest `args` version.

## 0.1.2+4

* Allow latest `args` version.

## 0.1.2+3

* Code cleanup.

## 0.1.2+2

* Stopped using deprecated features from `bot` package.

* Formatting

## 0.1.2+1

 * Updated `hop` and added `hop_unittest` dev dependencies.

## 0.1.2

* Fixed test runner.

## 0.1.1 2014-03-04
 * Removed unneeded dependency on `bot_io`
 * Cleanup of other references to `bot_io`

## 0.1.0 2014-02-15 (SDK 1.2.0-dev.5.7 32688)
 * First release
 * Maintains 100% compatibility with the `completion` library from the `bot_io`
   package as of release `0.25.1+2`.







 
