namespaces top-level property

FigGenerator namespaces
final

Implementation

final FigGenerator namespaces = FigGenerator(
  script: ["kubectl", "get", "namespaces"],
  postProcess: (String out, [List<String>? tokens]) {
    return out
        .split("\n")
        .skip(1)
        .map((line) {
          final parts = line.split(" ");
          if (parts.isEmpty) return null;
          return FigSuggestion(
            name: parts.first,
            description: "Kubernetes namespace",
          );
        })
        .whereType<FigSuggestion>()
        .toList();
  },
);