programGenerator top-level property
Implementation
final FigGenerator programGenerator = FigGenerator(
script: [
"bash",
"-c",
'for i in \$(echo \$PATH | tr ":" "\\n"); do [[ -d "\$i" ]] && find "\$i" -maxdepth 1 -type f -perm -111 && find "\$i" -maxdepth 1 -type l -perm -111; done',
],
postProcess: (String out, [List<String>? tokens]) {
return out
.split("\n")
.where((value) => value.startsWith("/"))
.map((path) => path.split("/").last)
.map((pr) => FigSuggestion(
name: pr,
description: "Executable file",
type: SuggestionType.arg,
))
.toList();
},
);