completionInstallationOverview function

String completionInstallationOverview(
  1. String executableName, {
  2. bool viaOption = false,
  3. String heading = 'Installation:',
})

Short installation instructions for all shells, one line per shell, under a heading. Used in the usage of the completion command.

Implementation

String completionInstallationOverview(
  final String executableName, {
  final bool viaOption = false,
  final String heading = 'Installation:',
}) {
  const labelWidth = 12;
  return [
    heading,
    for (final shell in CompletionShell.values)
      '  ${'${shell.displayName}:'.padRight(labelWidth)} '
          '${shell.installInstruction(executableName, viaOption: viaOption)}',
  ].join('\n');
}