printCompletionScript function

Future<void> printCompletionScript(
  1. CommandRunner<OptionDefinition, dynamic> runner,
  2. CompletionShell shell, {
  3. String? commandName,
})

Writes the completion script of shell for runner to CompletionSettings.sinks. See writeCompletionOutput.

commandName generates the script for a wrapper of the executable instead, see CompletionShell.script.

Implementation

Future<void> printCompletionScript(
  final CommandRunner runner,
  final CompletionShell shell, {
  final String? commandName,
}) {
  return writeCompletionOutput(
    runner,
    _CompletionRequest(runner, shell, commandName).script,
  );
}