{
  "id": "fpc",
  "name": "Free Pascal",
  "homepage": "https://www.freepascal.org/",
  "description": "A professional Pascal compiler",
  "executables": [
    "fpc",
    "ppcx64",
    "ppcarm"
  ],
  "dotfiles": {
    "paths": [
      "~/.fpc.cfg"
    ],
    "secret": [],
    "machine_lines": [
      {
        "file": "~/.fpc.cfg",
        "match": {
          "prefix": [
            "-Fu",
            "-Fi",
            "-Fl",
            "-FD",
            "-FU"
          ]
        },
        "scope": "platform"
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "Compile Pascal program",
    "description": "Compile a Pascal source file with fpc. Options are written attached to their value (-O2, -Mdelphi, -FEdir). Target selection, linking and assembler options are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "manual",
        "kind": "manual",
        "url": "https://man.archlinux.org/man/fpc.1",
        "revision": "fpc(1) man page",
        "evidence": "fpc [options] [sourcefile]\n-FE xxx  set the executable/unit output path to xxx\n-Fi xxx  adds xxx to the path where the compiler searches for its include files.\n-Fu xxx  Adds xxx to the unit path.\n-FU xxx  Tells the compiler to write units in directory xxx instead of the current directory.\n-g  Generate debugging information for debugging with GDB.\n-d xxx  Define the symbol name xxx. This can be used to conditionally compile parts of your code.\n-O xxx  optimize the compiler's output; 1 Level 1 optimizations (quick optimizations). 2 Level 2 optimizations (-O1 plus some slower optimizations). 3 Level 3 optimizations (-O2 plus -Ou).\n-o xxx  Tells the compiler to use xxx as the name of the output file (executable). Only with programs.\n-M mode  Specify the language mode. delphi, fpc, gpc, macpas, objfpc, tp\n-n  Tells the compiler not to read the configuration file fpc.cfg\n"
      }
    ],
    "field": [
      {
        "id": "source",
        "label": "Source file",
        "type": "path",
        "position": 0,
        "min": 1,
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "output",
        "label": "Output file name",
        "type": "string",
        "option": [
          "-o"
        ],
        "effect": "overwrite",
        "sources": [
          "manual"
        ]
      },
      {
        "id": "mode",
        "label": "Language mode",
        "type": "enum",
        "option": [
          "-M"
        ],
        "choices": [
          {
            "value": "fpc",
            "label": "FPC (default)"
          },
          {
            "value": "objfpc",
            "label": "Object Pascal"
          },
          {
            "value": "delphi",
            "label": "Delphi"
          },
          {
            "value": "tp",
            "label": "Turbo Pascal"
          },
          {
            "value": "macpas",
            "label": "Mac Pascal"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "optimize",
        "label": "Optimization level",
        "type": "enum",
        "option": [
          "-O"
        ],
        "choices": [
          {
            "value": "1",
            "label": "Level 1 (quick)"
          },
          {
            "value": "2",
            "label": "Level 2"
          },
          {
            "value": "3",
            "label": "Level 3"
          }
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "debug",
        "label": "Debug info (GDB)",
        "type": "boolean",
        "option": [
          "-g"
        ],
        "sources": [
          "manual"
        ]
      },
      {
        "id": "defines",
        "label": "Define symbols",
        "type": "string",
        "option": [
          "-d"
        ],
        "multiple": true,
        "sources": [
          "manual"
        ]
      },
      {
        "id": "unit_paths",
        "label": "Unit search paths",
        "type": "path",
        "option": [
          "-Fu"
        ],
        "multiple": true,
        "path": {
          "kind": "directory",
          "role": "input"
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "include_paths",
        "label": "Include search paths",
        "type": "path",
        "option": [
          "-Fi"
        ],
        "multiple": true,
        "path": {
          "kind": "directory",
          "role": "input"
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "exe_dir",
        "label": "Executable output directory",
        "type": "path",
        "option": [
          "-FE"
        ],
        "path": {
          "kind": "directory",
          "role": "output",
          "must_exist": false
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "unit_dir",
        "label": "Unit output directory",
        "type": "path",
        "option": [
          "-FU"
        ],
        "path": {
          "kind": "directory",
          "role": "output",
          "must_exist": false
        },
        "sources": [
          "manual"
        ]
      },
      {
        "id": "no_config",
        "label": "Ignore fpc.cfg",
        "type": "boolean",
        "option": [
          "-n"
        ],
        "sources": [
          "manual"
        ]
      }
    ],
    "task": [
      {
        "id": "compile",
        "label": "Compile",
        "fields": [
          "source",
          "mode",
          "output"
        ],
        "required": [
          "source"
        ]
      },
      {
        "id": "debug_build",
        "label": "Debug build",
        "fields": [
          "source",
          "mode",
          "debug"
        ],
        "required": [
          "source"
        ],
        "set": {
          "debug": [
            true
          ]
        }
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "source",
          "output",
          "mode",
          "optimize",
          "debug",
          "defines"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "unit_paths",
          "include_paths",
          "exe_dir",
          "unit_dir",
          "no_config"
        ]
      }
    ]
  }
}
