FLUTTER ECOSYSTEM

kevmoo/completion.dart

अपने एप्लिकेशन में शेल कमांड पूरा करने के लिए एक पैकेज

completion.dart प्रोजेक्ट कवर
Stars
62
Forks
11
अंतिम पुश (UTC)
12 सित॰ 2026
प्रोजेक्ट स्थिति
सक्रिय
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, USAआधिकारिक वेबसाइट ↗
भाषाएँDartShell

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 8 आइटम
  • args^2.0.0
  • logging^1.0.0
  • meta^1.18.1
  • path^1.8.0
  • checksडेवलपमेंट^0.3.1
  • dart_flutter_team_lintsडेवलपमेंट^3.0.0
  • testडेवलपमेंट^1.16.6
  • test_processडेवलपमेंट^2.0.0

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

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.