lsArg function

FigArg lsArg(
  1. String name,
  2. String command
)

Implementation

FigArg lsArg(String name, String command) {
  return FigArg(
    name: name,
    generators: [
      FigGenerator(
        script: ['tmux', command],
        postProcess: (out, [tokens]) {
          return out
              .split('\n')
              .where((line) => line.trim().isNotEmpty)
              .map((line) {
            final content = line.split(':');
            return FigSuggestion(
              name: content[0].trim(),
              description: content.length > 1 ? content[1].trim() : '',
            );
          }).toList();
        },
      ),
    ],
  );
}