FLUTTER ECOSYSTEM

kevmoo/completion.dart

Um pacote para adicionar conclusão de comando de shell ao seu aplicativo

Capa do projeto completion.dart
Stars
62
Forks
11
Último push (UTC)
12 de set. de 2026
Status do projeto
Ativo
Kevin Moore GitHub avatar
GITHUB User

Kevin Moore ↗

A Product Manager at @google working on @dart-lang and @flutter web technologies

@dart-lang @flutter @googleSeattle, WA, USASite oficial ↗
LinguagensDartShell

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 8 itens

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher README

Add shell command completion to your Dart console applications.

Dart CI pub package package publisher

To use this package, instead of this:

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:

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);
  if (argResults == null) return;
  // ...
}

(The main difference is calling completion.tryArgsCompletion in place of argParser.parse and returning early when it returns null.)

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), along with the target Shell.

Also, see the example.