{
  "name": "which",
  "description": "Locate a program in the user's PATH",
  "options": [
    {
      "names": [
        "-s"
      ],
      "description": "No output, return 0 if all the executables are found, 1 if not"
    },
    {
      "names": [
        "-a"
      ],
      "description": "List all instances of executables found, instead of just the first"
    }
  ],
  "args": [
    {
      "name": "names",
      "isVariadic": true,
      "filterStrategy": "fuzzy",
      "generators": [
        {
          "script": [
            "bash",
            "-c",
            "for i in $(echo $PATH | tr \":\" \"\n\"); do find $i -maxdepth 1 -perm -111 -type f; done"
          ]
        }
      ]
    }
  ]
}
