{
  "id": "sort",
  "name": "sort",
  "description": "Sort or merge records (lines) of text files.",
  "executables": [
    "sort"
  ],
  "commands": {
    "format": 1,
    "label": "Sort lines",
    "description": "Sort lines of files or standard input. Check mode, sort algorithms, memory and compression options are not included.",
    "quality": "ai-draft",
    "base": "fig:sort",
    "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/sort.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "files",
        "label": "Input files",
        "description": "Leave empty to read standard input.",
        "type": "path",
        "position": 0,
        "multiple": true,
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "output",
        "label": "Output file",
        "type": "path",
        "option": [
          "--output",
          "-o"
        ],
        "path": {
          "kind": "file",
          "role": "output"
        },
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "reverse",
        "label": "Reverse order",
        "type": "boolean",
        "option": [
          "--reverse",
          "-r"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "numeric",
        "label": "Numeric sort",
        "type": "boolean",
        "option": [
          "--numeric-sort",
          "-n"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "human",
        "label": "Human-numeric sort",
        "description": "Understands SI suffixes such as 2K and 1G.",
        "type": "boolean",
        "option": [
          "--human-numeric-sort",
          "-h"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "general",
        "label": "General numeric sort",
        "type": "boolean",
        "option": [
          "--general-numeric-sort",
          "-g"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "version",
        "label": "Version sort",
        "type": "boolean",
        "option": [
          "--version-sort",
          "-V"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "month",
        "label": "Month sort",
        "type": "boolean",
        "option": [
          "--month-sort",
          "-M"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "random",
        "label": "Random order",
        "type": "boolean",
        "option": [
          "--random-sort",
          "-R"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "unique",
        "label": "Unique lines only",
        "type": "boolean",
        "option": [
          "--unique",
          "-u"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "ignore_case",
        "label": "Ignore case",
        "type": "boolean",
        "option": [
          "--ignore-case",
          "-f"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "blanks",
        "label": "Ignore leading blanks",
        "type": "boolean",
        "option": [
          "--ignore-leading-blanks",
          "-b"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "dict",
        "label": "Dictionary order",
        "type": "boolean",
        "option": [
          "--dictionary-order",
          "-d"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "stable",
        "label": "Stable sort",
        "type": "boolean",
        "option": [
          "-s"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "merge",
        "label": "Merge pre-sorted files",
        "type": "boolean",
        "option": [
          "--merge",
          "-m"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "zero",
        "label": "NUL-terminated records",
        "type": "boolean",
        "option": [
          "--zero-terminated",
          "-z"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "key",
        "label": "Sort key",
        "description": "Field position such as 2 or 2,2.",
        "type": "string",
        "option": [
          "--key",
          "-k"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "sep",
        "label": "Field separator",
        "description": "A single character.",
        "type": "string",
        "option": [
          "--field-separator",
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "tmpdir",
        "label": "Temporary directory",
        "type": "string",
        "option": [
          "--temporary-directory",
          "-T"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "sort",
        "label": "Sort lines",
        "fields": [
          "files",
          "reverse",
          "unique",
          "ignore_case",
          "output"
        ],
        "required": []
      },
      {
        "id": "numeric",
        "label": "Sort numerically",
        "fields": [
          "files",
          "numeric",
          "reverse",
          "unique",
          "key",
          "sep",
          "output"
        ],
        "required": [],
        "set": {
          "numeric": [
            true
          ]
        },
        "lock": [
          "numeric"
        ]
      },
      {
        "id": "by-column",
        "label": "Sort by column",
        "fields": [
          "files",
          "key",
          "sep",
          "numeric",
          "reverse",
          "output"
        ],
        "required": [
          "key"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "files",
          "reverse",
          "numeric",
          "unique",
          "ignore_case",
          "key",
          "sep",
          "output"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "human",
          "general",
          "version",
          "month",
          "random",
          "blanks",
          "dict",
          "stable",
          "merge",
          "zero",
          "tmpdir"
        ]
      }
    ]
  }
}
