taskSpec top-level property

FigSpec taskSpec
final

Implementation

final FigSpec taskSpec = FigSpec(
  name: 'task',
  // loadSpec doesn't work for root commands; detect which `task` implementation is installed.
  generateSpec: (
    List<String> tokens,
    ExecuteCommandFunction executeShellCommand,
  ) async {
    try {
      final output = await executeShellCommand(
        const ExecuteCommandInput(
          command: 'task',
          args: ['--version'],
        ),
      );
      if (output.stdout.contains('Task')) {
        return _taskRootFrom(go_task.completionSpec);
      }
    } catch (_) {}

    return _taskRootFrom(taskwarriorSpec);
  },
  generateSpecCacheKey: 'version-detect',
);