{
  "id": "lsof",
  "name": "lsof",
  "description": "List open files.",
  "executables": [
    "lsof"
  ],
  "commands": {
    "format": 1,
    "label": "List open files",
    "description": "Select open files by process, user, command or network address. Field output, repeat mode and NFS options are left out.",
    "quality": "ai-draft",
    "base": "fig:lsof",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": true
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/lsof.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "network",
        "label": "Network files (-i)",
        "description": "Address as [46][protocol][@host][:port], for example :8080 or TCP@localhost. Leave unset for all network files.",
        "type": "string",
        "option": [
          "-i"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "pids",
        "label": "Process IDs",
        "description": "Comma-separated PIDs; prefix with ^ to exclude.",
        "type": "string",
        "option": [
          "-p"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "users",
        "label": "Users",
        "description": "Comma-separated login names or UIDs.",
        "type": "string",
        "option": [
          "-u"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "command",
        "label": "Command name prefix",
        "type": "string",
        "option": [
          "-c"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "and",
        "label": "AND the selections (default is OR)",
        "type": "boolean",
        "option": [
          "-a"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_hosts",
        "label": "No host name lookup",
        "type": "boolean",
        "option": [
          "-n"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_ports",
        "label": "No port name lookup",
        "type": "boolean",
        "option": [
          "-P"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "terse",
        "label": "Terse output (PIDs only)",
        "type": "boolean",
        "option": [
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "unix_sockets",
        "label": "Unix sockets only",
        "type": "boolean",
        "option": [
          "-U"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "names",
        "label": "Files or directories",
        "type": "path",
        "position": 0,
        "multiple": true,
        "path": {
          "kind": "any",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "port",
        "label": "Who is using a port",
        "fields": [
          "network",
          "no_hosts",
          "no_ports"
        ],
        "required": [
          "network"
        ],
        "set": {
          "no_hosts": [
            true
          ],
          "no_ports": [
            true
          ]
        }
      },
      {
        "id": "process",
        "label": "Files opened by a process",
        "fields": [
          "pids",
          "no_hosts",
          "no_ports"
        ],
        "required": [
          "pids"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "network",
          "pids",
          "no_hosts",
          "no_ports"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "and",
          "unix_sockets",
          "terse",
          "command",
          "users",
          "names"
        ]
      }
    ]
  }
}
