{
  "name": "grep",
  "description": "Matches patterns in input text. Supports simple patterns and regular expressions",
  "options": [
    {
      "names": [
        "--help"
      ],
      "description": "Print a usage message briefly summarizing these command-line options and the bug-reporting address, then exit"
    },
    {
      "names": [
        "-E",
        "--extended-regexp"
      ],
      "description": "Interpret PATTERN as an extended regular expression (-E is specified by POSIX.)"
    },
    {
      "names": [
        "-F",
        "--fixed-string"
      ],
      "description": "Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. (-F is specified by POSIX.)"
    },
    {
      "names": [
        "-G",
        "--basic-regexp"
      ],
      "description": "Interpret PATTERN as a basic regular expression (BRE, see below). This is the default"
    },
    {
      "names": [
        "-e",
        "--regexp"
      ],
      "description": "Use PATTERN as the pattern. This can be used to specify multiple search patterns, or to protect a pattern beginning with a hyphen (-). (-e is specified by POSIX.)",
      "takes_arg": true,
      "arg": {
        "name": "pattern"
      }
    },
    {
      "names": [
        "-i",
        "--ignore-case",
        "-y"
      ],
      "description": "Ignore case distinctions in both the PATTERN and the input files. (-i is specified by POSIX.)"
    },
    {
      "names": [
        "-v",
        "--invert-match"
      ],
      "description": "Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)"
    },
    {
      "names": [
        "-w",
        "--word-regexp"
      ],
      "description": "Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. "
    },
    {
      "names": [
        "-x",
        "--line-regexp"
      ],
      "description": "Select only those matches that exactly match the whole line. (-x is specified by POSIX.)"
    },
    {
      "names": [
        "-c",
        "--count"
      ],
      "description": "Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option, count non-matching lines. (-c is specified by POSIX.)"
    },
    {
      "names": [
        "--color"
      ],
      "description": "Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to displa",
      "takes_arg": true,
      "arg": {
        "name": "WHEN",
        "suggestions": [
          "never",
          "always",
          "auto"
        ]
      }
    },
    {
      "names": [
        "-L",
        "--files-without-match"
      ],
      "description": "Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match"
    },
    {
      "names": [
        "-l",
        "--files-with-matches"
      ],
      "description": "Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. (-l is specified by POSIX.)"
    },
    {
      "names": [
        "-m",
        "--max-count"
      ],
      "description": "Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after th",
      "takes_arg": true,
      "arg": {
        "name": "NUM"
      }
    },
    {
      "names": [
        "-o",
        "--only-matching"
      ],
      "description": "Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line"
    },
    {
      "names": [
        "-q",
        "--quiet",
        "--silent"
      ],
      "description": "Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the -s or --no-messages option. (-q is specified by PO"
    },
    {
      "names": [
        "-s",
        "--no-messages"
      ],
      "description": "Suppress error messages about nonexistent or unreadable files. Portability note: unlike GNU grep, 7th Edition Unix grep did not conform to POSIX, because it lacked -q and its -s option behaved like GN"
    },
    {
      "names": [
        "-b",
        "--byte-offset"
      ],
      "description": "Print the 0-based byte offset within the input file before each line of output. If -o (--only-matching) is specified, print the offset of the matching part itself"
    },
    {
      "names": [
        "-H",
        "--with-filename"
      ],
      "description": "Print the file name for each match. This is the default when there is more than one file to search"
    },
    {
      "names": [
        "-h",
        "--no-filename"
      ],
      "description": "Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search"
    },
    {
      "names": [
        "--label"
      ],
      "description": "Display input actually coming from standard input as input coming from file LABEL. This is especially useful when implementing tools like zgrep, e.g., gzip -cd foo.gz | grep --label=foo -H something",
      "takes_arg": true,
      "arg": {
        "name": "LABEL"
      }
    },
    {
      "names": [
        "-n",
        "--line-number"
      ],
      "description": "Prefix each line of output with the 1-based line number within its input file. (-n is specified by POSIX.)"
    },
    {
      "names": [
        "-T",
        "--initial-tab"
      ],
      "description": "Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal. This is useful with options that prefix their output to the actual content: -H"
    },
    {
      "names": [
        "-u",
        "--unix-byte-offsets"
      ],
      "description": "Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to"
    },
    {
      "names": [
        "--null"
      ],
      "description": "Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name. For example, grep -lZ outputs a zero byte after each file name instead of the usual newline. Th"
    },
    {
      "names": [
        "-A",
        "--after-context"
      ],
      "description": "Print num lines of trailing context after each match",
      "takes_arg": true,
      "arg": {
        "name": "NUM"
      }
    },
    {
      "names": [
        "-B",
        "--before-context"
      ],
      "description": "Print num lines of leading context before each match. See also the -A and -C options",
      "takes_arg": true,
      "arg": {
        "name": "NUM"
      }
    },
    {
      "names": [
        "-C",
        "--context"
      ],
      "description": "Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is give",
      "takes_arg": true,
      "arg": {
        "name": "NUM"
      }
    },
    {
      "names": [
        "-a",
        "--text"
      ],
      "description": "Treat all files as ASCII text. Normally grep will simply print ``Binary file ... matches'' if files contain binary characters. Use of this option forces grep to output lines matching the specified pat"
    },
    {
      "names": [
        "--binary-files"
      ],
      "description": "Controls searching and printing of binary files",
      "takes_arg": true,
      "arg": {
        "name": "value",
        "suggestions": [
          "binary",
          "without-match",
          "text"
        ]
      }
    },
    {
      "names": [
        "-D",
        "--devices"
      ],
      "description": "Specify the demanded action for devices, FIFOs and sockets",
      "takes_arg": true,
      "arg": {
        "name": "action",
        "suggestions": [
          "read",
          "skip"
        ]
      }
    },
    {
      "names": [
        "-d",
        "--directories"
      ],
      "description": "Specify the demanded action for directories",
      "takes_arg": true,
      "arg": {
        "name": "action",
        "suggestions": [
          "read",
          "skip",
          "recurse"
        ]
      }
    },
    {
      "names": [
        "--exclude"
      ],
      "description": "Note that --exclude patterns take priority over --include patterns, and if no --include pattern is specified, all files are searched that are not excluded. Patterns are matched to the full path specif",
      "takes_arg": true,
      "arg": {
        "name": "GLOB"
      }
    },
    {
      "names": [
        "--exclude-dir"
      ],
      "description": "If -R is specified, only directories matching the given filename pattern are searched.  Note that --exclude-dir patterns take priority over --include-dir patterns",
      "takes_arg": true,
      "arg": {
        "name": "dir",
        "template": "folders"
      }
    },
    {
      "names": [
        "-I"
      ],
      "description": "Ignore binary files. This option is equivalent to --binary-file=without-match option"
    },
    {
      "names": [
        "--include"
      ],
      "description": "If specified, only files matching the given filename pattern are searched. Note that --exclude patterns take priority over --include patterns. Patterns are matched to the full path specified, not only",
      "takes_arg": true,
      "arg": {
        "name": "GLOB"
      }
    },
    {
      "names": [
        "--include-dir"
      ],
      "description": "If -R is specified, only directories matching the given filename pattern are searched. Note that --exclude-dir patterns take priority over --include-dir patterns",
      "takes_arg": true,
      "arg": {
        "name": "dir",
        "template": "folders"
      }
    },
    {
      "names": [
        "-R",
        "-r",
        "--recursive"
      ],
      "description": "Recursively search subdirectories listed"
    },
    {
      "names": [
        "--line-buffered"
      ],
      "description": "Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise"
    },
    {
      "names": [
        "-U",
        "--binary"
      ],
      "description": "Search binary files, but do not attempt to print them"
    },
    {
      "names": [
        "-J",
        "-bz2decompress"
      ],
      "description": "Decompress the bzip2(1) compressed file before looking for the text"
    },
    {
      "names": [
        "-V",
        "--version"
      ],
      "description": "Print version number of grep to the standard output stream"
    },
    {
      "names": [
        "-P",
        "--perl-regexp"
      ],
      "description": "Interpret pattern as a Perl regular expression"
    },
    {
      "names": [
        "-f",
        "--file"
      ],
      "description": "Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing. (-f is specified by POSIX.)",
      "takes_arg": true,
      "arg": {
        "name": "FILE",
        "template": "filepaths"
      }
    }
  ],
  "args": [
    {
      "name": "search pattern"
    },
    {
      "name": "file",
      "template": "filepaths"
    }
  ]
}
