completion 0.2.1+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 88

Add shell command completion to your Dart console applications.

Build Status Coverage Status

To use this package, instead of this:

import 'packages:args/args.dart';

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

do this:

import 'packages:args/args.dart';
import 'packages:completion/completion.dart' as completion;

void main(List<String> args) {
  ArgParser argParser = new ArgParser();
  argParser.addFlag('option', help: 'flag help');
  // ... add more options ...
  ArgResults 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.

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

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.

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate completion

2. Use it

The package has the following executables:


$ shell_completion_generator

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  completion: ^0.2.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:completion/completion.dart';
  
Version Uploaded Documentation Archive
0.2.1+1 Jul 26, 2018 Go to the documentation of completion 0.2.1+1 Download completion 0.2.1+1 archive
0.2.1 Jul 18, 2018 Go to the documentation of completion 0.2.1 Download completion 0.2.1 archive
0.2.0 Jul 10, 2018 Go to the documentation of completion 0.2.0 Download completion 0.2.0 archive
0.1.6 Feb 16, 2017 Go to the documentation of completion 0.1.6 Download completion 0.1.6 archive
0.1.5 Oct 8, 2015 Go to the documentation of completion 0.1.5 Download completion 0.1.5 archive
0.1.4 Apr 16, 2015 Go to the documentation of completion 0.1.4 Download completion 0.1.4 archive
0.1.3 Mar 7, 2015 Go to the documentation of completion 0.1.3 Download completion 0.1.3 archive
0.1.2+6 Dec 29, 2014 Go to the documentation of completion 0.1.2+6 Download completion 0.1.2+6 archive
0.1.2+5 Oct 8, 2014 Go to the documentation of completion 0.1.2+5 Download completion 0.1.2+5 archive
0.1.2+4 Aug 28, 2014 Go to the documentation of completion 0.1.2+4 Download completion 0.1.2+4 archive

All 18 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
77
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, other

Primary library: package:completion/completion.dart with components: io.

Suggestions

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use completion.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.54.0 <3.0.0
args ^1.4.0 1.5.0
logging ^0.11.0 0.11.3+2
path ^1.0.0 1.6.2
Dev dependencies
test ^1.2.0
test_process ^1.0.1