{
  "name": "lsof",
  "description": "List open files",
  "options": [
    {
      "names": [
        "-?",
        "-h",
        "--help"
      ],
      "description": "Help"
    },
    {
      "names": [
        "-a"
      ],
      "description": "Apply AND to the selections (defaults to OR)"
    },
    {
      "names": [
        "-b"
      ],
      "description": "Avoid kernel blocks"
    },
    {
      "names": [
        "-c"
      ],
      "description": "Select the listing of files for processes executing a command",
      "args": [
        {
          "name": "string or regexp (optional ending with /i /b /x)"
        }
      ]
    },
    {
      "names": [
        "+c"
      ],
      "description": "COMMAND width (9)",
      "args": [
        {
          "name": "number"
        }
      ]
    },
    {
      "names": [
        "+d"
      ],
      "description": "Search for all open instances/files/directories of directory",
      "args": [
        {
          "name": "file",
          "template": "folders"
        }
      ]
    },
    {
      "names": [
        "-d"
      ],
      "description": "Specify a list of file descriptors (FDs) to exclude from or include in the output listing",
      "args": [
        {
          "name": "File descriptor number"
        }
      ]
    },
    {
      "names": [
        "+D"
      ],
      "description": "Search tree for all open instances/files/directories of directory. *SLOW?*",
      "args": [
        {
          "name": "file",
          "template": "folders"
        }
      ]
    },
    {
      "names": [
        "+f"
      ],
      "description": "Enable path name arguments to be interpreted",
      "args": [
        {
          "name": "flags",
          "isOptional": true,
          "suggestions": [
            "c",
            "g",
            "G"
          ]
        }
      ]
    },
    {
      "names": [
        "-f"
      ],
      "description": "Inhibit path name arguments to be interpreted",
      "args": [
        {
          "name": "flags",
          "suggestions": [
            "c",
            "g",
            "G"
          ]
        }
      ]
    },
    {
      "names": [
        "-F"
      ],
      "description": "Select fields to output",
      "args": [
        {
          "name": "options",
          "isVariadic": true,
          "suggestions": [
            "a",
            "c",
            "C",
            "d",
            "D",
            "f",
            "G",
            "i",
            "k",
            "K",
            "l",
            "L",
            "m",
            "M",
            "n",
            "o",
            "p",
            "g",
            "P",
            "r",
            "R",
            "s",
            "S",
            "t",
            "T",
            "u",
            "0"
          ]
        }
      ]
    },
    {
      "names": [
        "-F?"
      ],
      "description": "Show fields for -F"
    },
    {
      "names": [
        "-g"
      ],
      "description": "Exclude or select by process group IDs (PGID)",
      "args": [
        {
          "name": "PGID",
          "description": "Process Group ID (comma separated)"
        }
      ]
    },
    {
      "names": [
        "-i"
      ],
      "description": "Selects files by [46][protocol][@hostname|hostaddr][:service|port]",
      "args": [
        {
          "name": "options",
          "generators": [
            {
              "script": [
                "echo"
              ]
            },
            {
              "script": [
                "echo"
              ]
            },
            {
              "script": [
                "ifconfig"
              ],
              "trigger": "@"
            },
            {
              "script": [
                "echo"
              ],
              "trigger": ":"
            }
          ]
        }
      ]
    },
    {
      "names": [
        "-l"
      ],
      "description": "Inhibit conversion of user IDs to login names"
    },
    {
      "names": [
        "+L"
      ],
      "description": "Enable listing of file link counts",
      "args": [
        {
          "name": "number",
          "isOptional": true
        }
      ]
    },
    {
      "names": [
        "-L"
      ],
      "description": "Disable listing of file link counts",
      "args": [
        {
          "name": "number",
          "isOptional": true
        }
      ]
    },
    {
      "names": [
        "+M"
      ],
      "description": "Enable portMap registration"
    },
    {
      "names": [
        "-M"
      ],
      "description": "Disable portMap registration"
    },
    {
      "names": [
        "-n"
      ],
      "description": "No host names"
    },
    {
      "names": [
        "-N"
      ],
      "description": "Select NFS files"
    },
    {
      "names": [
        "-o"
      ],
      "description": "List file offset"
    },
    {
      "names": [
        "-O"
      ],
      "description": "No overhead *RISKY*"
    },
    {
      "names": [
        "-p"
      ],
      "description": "Exclude or select process identification numbers (PIDs)",
      "args": [
        {
          "name": "PIDs",
          "description": "PIDs to select or exclude ( with ^)"
        }
      ]
    },
    {
      "names": [
        "-P"
      ],
      "description": "No port names"
    },
    {
      "names": [
        "+r"
      ],
      "description": "Repeat every t seconds (15) until no files",
      "args": [
        {
          "name": "time (seconds)",
          "description": "Time per repeat"
        }
      ]
    },
    {
      "names": [
        "-r"
      ],
      "description": "Repeat every t seconds (15) forever",
      "args": [
        {
          "name": "time (seconds)",
          "description": "Time per repeat"
        }
      ]
    },
    {
      "names": [
        "-R"
      ],
      "description": "List parent PID"
    },
    {
      "names": [
        "-s"
      ],
      "description": "List file size or exclude/select protocol",
      "args": [
        {
          "name": "protocol:state",
          "isOptional": true
        }
      ]
    },
    {
      "names": [
        "-S"
      ],
      "description": "Stat timeout in seconds (lstat/readlink/stat)",
      "args": [
        {
          "name": "timeout (seconds)",
          "isOptional": true
        }
      ]
    },
    {
      "names": [
        "-T"
      ],
      "description": "Disable TCP/TPI info",
      "args": [
        {
          "name": "info",
          "suggestions": [
            "f",
            "q",
            "s",
            "w",
            ""
          ]
        }
      ]
    },
    {
      "names": [
        "-t"
      ],
      "description": "Specify terse listing"
    },
    {
      "names": [
        "-u"
      ],
      "description": "Exclude/select login|UID set",
      "args": [
        {
          "name": "UIDs"
        }
      ]
    },
    {
      "names": [
        "-U"
      ],
      "description": "Select Unix socket"
    },
    {
      "names": [
        "-v"
      ],
      "description": "List version info"
    },
    {
      "names": [
        "-V"
      ],
      "description": "Verbose search"
    },
    {
      "names": [
        "+w"
      ],
      "description": "Enable warnings"
    },
    {
      "names": [
        "-w"
      ],
      "description": "Disable warnings"
    },
    {
      "names": [
        "-x"
      ],
      "description": "Cross over +d|+D File systems or symbolic links",
      "args": [
        {
          "name": "cross-over option",
          "suggestions": [
            "f",
            "l"
          ]
        }
      ]
    },
    {
      "names": [
        "-X"
      ],
      "description": "File descriptor table only"
    }
  ],
  "args": [
    {
      "name": "names",
      "description": "Select named files or files on named file systems",
      "isOptional": true,
      "isVariadic": true,
      "template": "folders"
    }
  ]
}
