{
  "id": "cgrep",
  "name": "CGrep",
  "homepage": "https://github.com/awgn/cgrep",
  "description": "Context-aware grep for source codes.",
  "executables": [
    "cgrep"
  ],
  "dotfiles": {
    "paths": [
      "~/.cgreprc",
      "[configHome]/cgrep/cgreprc"
    ],
    "exclude": [],
    "secret": [],
    "side_effect": false
  },
  "commands": {
    "format": 1,
    "label": "Search source code",
    "description": "Context-aware grep that can limit matches to code, comments or string literals. Semantic -S patterns, file-type filters and editor launching are mostly left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": false,
      "short_bundles": false
    },
    "source": [
      {
        "id": "readme",
        "kind": "help",
        "url": "https://github.com/awgn/cgrep",
        "revision": "9.3.1",
        "evidence": "Usage: cgrep [OPTION] [PATTERN] files...\n  -w,--word                Force word matching\n  -e,--edit                Use edit distance\n  -G,--regex               Use regex matching (posix)\n  -i,--ignore-case         Ignore case distinctions\n  -c,--code                Enable search in source code\n  -m,--comment             Enable search in comments\n  -l,--literal             Enable search in string literals\n  -T,--tests-only          Search only in test files\n  --no-tests               Exclude test files from search\n  -r,--recursive           Enable recursive search (don't follow symlinks)\n  --max-count INT          Stop search in files after INT matches\n  -v,--invert-match        Select non-matching lines\n  --count                  Print only a count of matching lines per file\n  --filename-only          Print only the name of files containing matches\n  --json                   Format output as json object\n"
      }
    ],
    "field": [
      {
        "id": "pattern",
        "label": "Pattern",
        "type": "string",
        "position": 0,
        "sources": [
          "readme"
        ]
      },
      {
        "id": "files",
        "label": "Files or directories",
        "type": "path",
        "position": 1,
        "multiple": true,
        "path": {
          "kind": "any",
          "role": "input"
        },
        "sources": [
          "readme"
        ]
      },
      {
        "id": "recursive",
        "label": "Recursive",
        "type": "boolean",
        "option": [
          "--recursive",
          "-r"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "ignore_case",
        "label": "Ignore case",
        "type": "boolean",
        "option": [
          "--ignore-case",
          "-i"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "word",
        "label": "Whole word",
        "type": "boolean",
        "option": [
          "--word",
          "-w"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "regex",
        "label": "POSIX regex",
        "type": "boolean",
        "option": [
          "--regex",
          "-G"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "code",
        "label": "Search code",
        "type": "boolean",
        "option": [
          "--code",
          "-c"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "comment",
        "label": "Search comments",
        "type": "boolean",
        "option": [
          "--comment",
          "-m"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "literal",
        "label": "Search string literals",
        "type": "boolean",
        "option": [
          "--literal",
          "-l"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "no_tests",
        "label": "Exclude test files",
        "type": "boolean",
        "option": [
          "--no-tests"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "invert",
        "label": "Invert match",
        "type": "boolean",
        "option": [
          "--invert-match",
          "-v"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "max_count",
        "label": "Max matches per file",
        "type": "integer",
        "option": [
          "--max-count"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "count",
        "label": "Count only",
        "type": "boolean",
        "option": [
          "--count"
        ],
        "sources": [
          "readme"
        ]
      },
      {
        "id": "filename_only",
        "label": "File names only",
        "type": "boolean",
        "option": [
          "--filename-only"
        ],
        "sources": [
          "readme"
        ]
      }
    ],
    "task": [
      {
        "id": "search",
        "label": "Search a tree",
        "fields": [
          "pattern",
          "files",
          "recursive",
          "ignore_case"
        ],
        "required": [
          "pattern"
        ],
        "set": {
          "recursive": [
            true
          ]
        }
      },
      {
        "id": "comments",
        "label": "Search comments only",
        "fields": [
          "pattern",
          "files",
          "comment",
          "recursive"
        ],
        "required": [
          "pattern",
          "comment"
        ],
        "set": {
          "comment": [
            true
          ],
          "recursive": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "pattern",
          "files",
          "recursive",
          "ignore_case",
          "word",
          "regex",
          "code",
          "comment",
          "literal"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "no_tests",
          "invert",
          "max_count",
          "count",
          "filename_only"
        ]
      }
    ]
  }
}
