{
  "id": "zig",
  "name": "Zig",
  "description": "A general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.",
  "homepage": "https://ziglang.org",
  "executables": [
    "zig"
  ],
  "commands": {
    "format": 1,
    "label": "Zig toolchain",
    "description": "Build, run and format Zig sources. Only common compiler flags are included; linker, WebAssembly and debug flags are left out.",
    "quality": "ai-draft",
    "base": "fig:zig",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/zig.ts",
        "license": "MIT"
      }
    ],
    "subcommand": [
      {
        "path": [
          "build-exe"
        ],
        "label": "Build executable",
        "description": "Create an executable from Zig source or object files.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/zig.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "files",
            "label": "Source files",
            "type": "path",
            "position": 0,
            "multiple": true,
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "optimize",
            "label": "Optimize mode",
            "type": "enum",
            "option": [
              "-O"
            ],
            "choices": [
              {
                "value": "Debug",
                "label": "Debug"
              },
              {
                "value": "ReleaseFast",
                "label": "ReleaseFast"
              },
              {
                "value": "ReleaseSafe",
                "label": "ReleaseSafe"
              },
              {
                "value": "ReleaseSmall",
                "label": "ReleaseSmall"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "name",
            "label": "Output name",
            "description": "Override the root name (not a file path).",
            "type": "string",
            "option": [
              "--name"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "strip",
            "label": "Omit debug symbols",
            "type": "boolean",
            "option": [
              "-fstrip"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "single_threaded",
            "label": "Single-threaded",
            "type": "boolean",
            "option": [
              "-fsingle-threaded"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "static",
            "label": "Static link",
            "type": "boolean",
            "option": [
              "-static"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "library",
            "label": "Link libraries",
            "type": "string",
            "option": [
              "--library",
              "-l"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "debug",
            "label": "Debug build",
            "fields": [
              "files",
              "name"
            ],
            "required": [
              "files"
            ]
          },
          {
            "id": "release",
            "label": "Small release build",
            "fields": [
              "files",
              "optimize",
              "strip",
              "name"
            ],
            "required": [
              "files"
            ],
            "set": {
              "optimize": [
                "ReleaseSmall"
              ],
              "strip": [
                true
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "files",
              "optimize",
              "name"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "strip",
              "single_threaded",
              "static",
              "library"
            ]
          }
        ]
      },
      {
        "path": [
          "run"
        ],
        "label": "Build and run",
        "description": "Create an executable and run it immediately.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/zig.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "files",
            "label": "Source files",
            "type": "path",
            "position": 0,
            "multiple": true,
            "path": {
              "kind": "file",
              "role": "input"
            },
            "sources": [
              "fig"
            ]
          },
          {
            "id": "optimize",
            "label": "Optimize mode",
            "type": "enum",
            "option": [
              "-O"
            ],
            "choices": [
              {
                "value": "Debug",
                "label": "Debug"
              },
              {
                "value": "ReleaseFast",
                "label": "ReleaseFast"
              },
              {
                "value": "ReleaseSafe",
                "label": "ReleaseSafe"
              },
              {
                "value": "ReleaseSmall",
                "label": "ReleaseSmall"
              }
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "library",
            "label": "Link libraries",
            "type": "string",
            "option": [
              "--library",
              "-l"
            ],
            "multiple": true,
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "run",
            "label": "Run a file",
            "fields": [
              "files",
              "optimize"
            ],
            "required": [
              "files"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "files",
              "optimize",
              "library"
            ]
          }
        ]
      },
      {
        "path": [
          "fmt"
        ],
        "label": "Format source",
        "description": "Reformat Zig source into canonical form.",
        "source": [
          {
            "id": "fig",
            "kind": "completion",
            "url": "https://github.com/withfig/autocomplete/blob/master/src/zig.ts",
            "license": "MIT"
          }
        ],
        "field": [
          {
            "id": "files",
            "label": "Files or directories",
            "type": "path",
            "position": 0,
            "multiple": true,
            "path": {
              "kind": "any",
              "role": "input"
            },
            "effect": "overwrite",
            "sources": [
              "fig"
            ]
          },
          {
            "id": "check",
            "label": "Check only",
            "description": "List non-conforming files and exit with an error.",
            "type": "boolean",
            "option": [
              "--check"
            ],
            "sources": [
              "fig"
            ]
          },
          {
            "id": "ast_check",
            "label": "Run ast-check",
            "type": "boolean",
            "option": [
              "--ast-check"
            ],
            "sources": [
              "fig"
            ]
          }
        ],
        "task": [
          {
            "id": "format",
            "label": "Format files",
            "fields": [
              "files"
            ],
            "required": [
              "files"
            ]
          },
          {
            "id": "check",
            "label": "Check formatting",
            "fields": [
              "files",
              "check"
            ],
            "required": [
              "files"
            ],
            "set": {
              "check": [
                true
              ]
            }
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "files",
              "check",
              "ast_check"
            ]
          }
        ]
      }
    ]
  }
}
