describeCommand function

String describeCommand(
  1. List<String> command
)

Shell-style rendering of a command, for showing the user what runs.

Implementation

String describeCommand(List<String> command) => command
    .map((a) =>
        a.contains(RegExp(r'[\s"]')) ? '"${a.replaceAll('"', r'\"')}"' : a)
    .join(' ');