{
  "id": "xargs",
  "name": "xargs",
  "description": "Builds and runs commands from whitespace-delimited standard input.",
  "executables": [
    "xargs"
  ],
  "commands": {
    "format": 1,
    "label": "Run a command per input batch",
    "description": "Choose how xargs batches stdin into the command line. The command and its fixed arguments are typed as separate words; less common size limits are left out.",
    "quality": "ai-draft",
    "base": "fig:xargs",
    "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/xargs.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "null_sep",
        "label": "NUL-separated input",
        "type": "boolean",
        "option": [
          "-0"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "replace",
        "label": "Replacement string",
        "description": "Occurrences of this string in the command are replaced by each input item.",
        "type": "string",
        "option": [
          "-I"
        ],
        "suggestions": [
          {
            "value": "{}",
            "label": "{}"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "max_args",
        "label": "Max arguments per run",
        "type": "integer",
        "option": [
          "-n"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "parallel",
        "label": "Parallel processes",
        "description": "0 runs as many as possible.",
        "type": "integer",
        "option": [
          "-P"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "prompt",
        "label": "Prompt before each run",
        "type": "boolean",
        "option": [
          "-p"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_run_empty",
        "label": "Skip when input is empty",
        "type": "boolean",
        "option": [
          "-r"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "trace",
        "label": "Echo each command",
        "type": "boolean",
        "option": [
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "eof",
        "label": "Logical EOF marker",
        "type": "string",
        "option": [
          "-E"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "command",
        "label": "Command and arguments",
        "description": "Defaults to echo when empty.",
        "type": "string",
        "position": 0,
        "multiple": true,
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "each-line",
        "label": "One run per item",
        "fields": [
          "null_sep",
          "max_args",
          "trace",
          "command"
        ],
        "set": {
          "max_args": [
            1
          ]
        },
        "required": [
          "command"
        ]
      },
      {
        "id": "parallel",
        "label": "Parallel run",
        "fields": [
          "null_sep",
          "max_args",
          "parallel",
          "no_run_empty",
          "command"
        ],
        "set": {
          "max_args": [
            1
          ],
          "parallel": [
            4
          ]
        },
        "required": [
          "command"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "command",
          "null_sep",
          "max_args",
          "parallel",
          "replace"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "prompt",
          "no_run_empty",
          "trace",
          "eof"
        ]
      }
    ]
  }
}
