{
  "id": "cpp",
  "name": "c++",
  "description": "The system C++ compiler driver.",
  "executables": [
    "c++"
  ],
  "commands": {
    "format": 1,
    "label": "Compile C++",
    "description": "Compile or link C++ sources. Only common options are offered; warnings, optimization levels and linker libraries are left out.",
    "quality": "ai-draft",
    "base": "fig:c++",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/c++.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "files",
        "label": "Source files",
        "type": "path",
        "position": 0,
        "multiple": true,
        "path": {
          "kind": "file",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "output",
        "label": "Output file",
        "type": "path",
        "option": [
          "-o"
        ],
        "path": {
          "kind": "file",
          "role": "output",
          "must_exist": false
        },
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "std",
        "label": "Language standard",
        "type": "string",
        "option": [
          "-std="
        ],
        "suggestions": [
          {
            "value": "c++11",
            "label": "C++11"
          },
          {
            "value": "c++14",
            "label": "C++14"
          },
          {
            "value": "c++17",
            "label": "C++17"
          },
          {
            "value": "c++20",
            "label": "C++20"
          },
          {
            "value": "c++2b",
            "label": "C++23 (c++2b)"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "compile_only",
        "label": "Compile only (no link)",
        "type": "boolean",
        "option": [
          "-c"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "debug",
        "label": "Debug info",
        "type": "boolean",
        "option": [
          "-g"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "include_dirs",
        "label": "Include directories",
        "type": "path",
        "option": [
          "-I"
        ],
        "multiple": true,
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "lib_dirs",
        "label": "Library directories",
        "type": "path",
        "option": [
          "-L"
        ],
        "multiple": true,
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "defines",
        "label": "Macro definitions",
        "description": "NAME or NAME=value.",
        "type": "string",
        "option": [
          "-D"
        ],
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "pthread",
        "label": "POSIX threads",
        "type": "boolean",
        "option": [
          "-pthread"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "preprocess",
        "label": "Preprocess only",
        "type": "boolean",
        "option": [
          "-E"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "build",
        "label": "Build an executable",
        "fields": [
          "files",
          "output",
          "std"
        ],
        "required": [
          "files"
        ]
      },
      {
        "id": "object",
        "label": "Compile to an object file",
        "fields": [
          "files",
          "std",
          "compile_only"
        ],
        "required": [
          "files"
        ],
        "set": {
          "compile_only": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "files",
          "output",
          "std",
          "compile_only",
          "debug"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "include_dirs",
          "lib_dirs",
          "defines",
          "pthread",
          "preprocess"
        ]
      }
    ]
  }
}
