Add Bash and Zsh command-line completion for flutter (#19243)

This uses @kevmoo's completion package to do command line completion for flutter, and a new command "bash-completion" (with alias "zsh-completion") that will output the necessary shell script setup code, and adds the hidden command "completion" that does the actual completion.

Because it adds a dependency, I also had to do flutter update-packages --force-upgrade.

Fixes #18988.
This commit is contained in:
Greg Spencer
2018-07-13 21:24:36 -07:00
committed by GitHub
parent 1b35cc2cc2
commit 5d0d1b038f
32 changed files with 416 additions and 228 deletions

View File

@@ -27,6 +27,7 @@ import 'src/commands/packages.dart';
import 'src/commands/precache.dart';
import 'src/commands/run.dart';
import 'src/commands/screenshot.dart';
import 'src/commands/shell_completion.dart';
import 'src/commands/stop.dart';
import 'src/commands/test.dart';
import 'src/commands/trace.dart';
@@ -53,7 +54,6 @@ Future<Null> main(List<String> args) async {
new BuildCommand(verboseHelp: verboseHelp),
new ChannelCommand(verboseHelp: verboseHelp),
new CleanCommand(),
new InjectPluginsCommand(hidden: !verboseHelp),
new ConfigCommand(verboseHelp: verboseHelp),
new CreateCommand(),
new DaemonCommand(hidden: !verboseHelp),
@@ -64,12 +64,14 @@ Future<Null> main(List<String> args) async {
new FormatCommand(),
new FuchsiaReloadCommand(),
new IdeConfigCommand(hidden: !verboseHelp),
new InjectPluginsCommand(hidden: !verboseHelp),
new InstallCommand(),
new LogsCommand(),
new PackagesCommand(),
new PrecacheCommand(),
new RunCommand(verboseHelp: verboseHelp),
new ScreenshotCommand(),
new ShellCompletionCommand(verboseHelp: verboseHelp),
new StopCommand(),
new TestCommand(verboseHelp: verboseHelp),
new TraceCommand(),