#compdef kde-builder

# SPDX-FileCopyrightText: None
#
# SPDX-License-Identifier: CC0-1.0

# See https://kde-builder.kde.org/en/cmdline/supported-cmdline-params.html for description of options.

_arguments \
  --all-config-projects"[Select all projects defined in user config]" \
  --all-kde-projects"[Select all known kde projects defined in metadata]" \
  "(--async --no-async)"{--async,--no-async}"[Perform source update and build process in parallel]" \
  --binpath"[Set the environment variable PATH while building]"":argument:" \
  --branch-group"[General group from which you want projects to be chosen]"":argument:" \
  --branch"[Checkout the specified branch]"":argument:" \
  --build-dir"[The directory that contains the built sources]"":argument:" \
  "(--build-only --no-build)"--build-only"[Only perform the build process]" \
  --build-system-only"[Abort building a project just before the make command]" \
  "(--check-self-updates --no-check-self-updates)"{--check-self-updates,--no-check-self-updates}"[Show a message when kde-builder detects it is outdated]" \
  --cmake-generator"[Which generator to use with CMake]"":argument:" \
  --cmake-options"[Flags to pass to CMake when creating the build system for the project]"":argument:" \
  "(--color --no-color --colorful-output --no-colorful-output)"{--color,--no-color,--colorful-output,--no-colorful-output}"[Toggle colorful output]" \
  "(--compile-commands-export --no-compile-commands-export)"{--compile-commands-export,--no-compile-commands-export}"[Generation of a compile_commands.json]" \
  "(--compile-commands-linking --no-compile-commands-linking)"{--compile-commands-linking,--no-compile-commands-linking}"[Creation of symbolic links from compile_commands.json to source directory]" \
  --configure-flags"[Flags to pass to ./configure ]"":argument:" \
  --cxxflags"[Flags to use for building the project]"":argument:" \
  --debug"[Enable debug mode]" \
  "(--dependency-tree --dependency-tree-fullpath)"--dependency-tree"[Print out dependency information on the projects that would be built]" \
  "(--dependency-tree --dependency-tree-fullpath)"--dependency-tree-fullpath"[Print out dependency information (fullpath) on the projects that would be built]" \
  --dest-dir"[The name a project is given on disk]"":argument:" \
  --directory-layout"[Layout which kde-builder should use when creating source and build directories]"":argument:" \
  "(--generate-clion-project-config --no-generate-clion-project-config)"{--generate-clion-project-config,--no-generate-clion-project-config}"[Generate a clion project config]" \
  --generate-config"[Installs a base config file]" \
  "(--generate-qtcreator-project-config --no-generate-qtcreator-project-config)"{--generate-qtcreator-project-config,--no-generate-qtcreator-project-config}"[Generate a qtcreator project config]" \
  "(--generate-vscode-project-config --no-generate-vscode-project-config)"{--generate-vscode-project-config,--no-generate-vscode-project-config}"[Generate a vscode project config]" \
  --git-user"[Specify user identity for newly cloned projects]"":argument:" \
  "(--help -h)"{--help,-h}"[Displays help on commandline options]" \
  "(--hold-performance-profile --no-hold-performance-profile)"{--hold-performance-profile,--no-hold-performance-profile}"[Use power-profiles-daemon to hold performance profile]" \
  "(--hold-work-branches --no-hold-work-branches)"{--hold-work-branches,--no-hold-work-branches}"[Skip updating projects which are currently at work/* or mr/* branch]" \
  "(-! --ignore-projects)"{-!,--ignore-projects}"[Do not include specified projects in the update/build process]"":::_kde-builder_projects_and_groups" \
  "(--include-dependencies --no-include-dependencies -D -d)"{--include-dependencies,--no-include-dependencies,-D,-d}"[Builds/Skip KDE-based dependencies]" \
  --initial-setup"[Installs Plasma env vars (~/.bashrc), required system pkgs, and a base config file]" \
  --install-dir"[Where to install the project after it is built]"":argument:" \
  --install-distro-packages"[Installs required system pkgs]" \
  "(--install-login-session --no-install-login-session)"{--install-login-session,--no-install-login-session}"[Install a login session]" \
  --install-login-session-only"[Skip updating and building everything and only install a login session]" \
  "(--install-only --no-install)"--install-only"[Only perform the install process]" \
  --libname"[Default name of the installed library directory]"":argument:" \
  --libpath"[Set the environment variable LD_LIBRARY_PATH while building]"":argument:" \
  --list-installed"[Print installed projects and exit]" \
  --log-dir"[Directory used to hold the log files generated by the script]"":argument:" \
  --log-level"[Set specific logger to specific level]"":argument:" \
  --make-install-prefix"[A command and its options to precede the make install command used to install projects]"":argument:" \
  --make-options"[Pass command line options to the make command]"":argument:" \
  --meson-options"[Pass command line options to the meson configure command]"":argument:" \
  --metadata-only"[Only perform the metadata download process]" \
  "(--nice --niceness)"{--nice,--niceness}"[Priority kde-builder will set for itself]"":argument:" \
  --ninja-options"[Pass command line options to the ninja build command]"":argument:" \
  "(--build-only --no-build)"--no-build"[Do not build the sources]" \
  "(--install-only --no-install)"--no-install"[Skip the install process]" \
  "(-M --no-metadata)"{-M,--no-metadata}"[Skip the metadata download process]" \
  "(--src-only -S -s --no-src)"{-S,--no-src}"[Do not perform update source code]" \
  --num-cores-low-mem"[Set the number of CPUs that is deemed safe for heavyweight or other highly-intensive projects]"":argument:" \
  --num-cores"[Set the number of available CPUs]"":argument:" \
  --override-build-system"[Manually specify the correct build type]"":argument:" \
  --persistent-data-file"[Change where kde-builder stores its persistent data]"":argument:" \
  "(--dry-run --pretend -p)"{--dry-run,--pretend,-p}"[Dont actually take major actions, instead describe what would be done]" \
  --prompt-answer"[Automatically answer when installing distro packages]"":argument:" \
  "(--purge-old-logs --no-purge-old-logs)"{--purge-old-logs,--no-purge-old-logs}"[Automatically delete old log directories]" \
  --qmake-options"[Options passed to the qmake command]"":argument:" \
  --qt-install-dir"[Where to install qt projects (modules) after build]"":argument:" \
  --query"[Query a parameter of the projects in the build list]"":argument:" \
  --rc-file"[Read configuration from filename instead of default]"":::_files" \
  --rebuild-failures"[Only those projects which failed to build on a previous run.]" \
  --reconfigure"[Run cmake or configure again, without cleaning the build directory]" \
  --clean-build-first"[Start the build from scratch of first project]" \
  "(--clean-build -c)"{--clean-build,-c}"[Start the build from scratch]" \
  --remove-after-install"[Delete the source and/or build directory after the project is successfully installed]"":argument:" \
  --resume"[Resume after a build failure]" \
  "(--after --from --resume-after --resume-from -a -f)"{--after,--resume-after,-a}"[Skips modules until just after the given project, then operates as normal]"":::_kde-builder_projects_and_groups" \
  "(--after --from --resume-after --resume-from -a -f)"{--from,--resume-from,-f}"[Skips modules until just before the given project, then operates as normal]"":::_kde-builder_projects_and_groups" \
  -R"[Resume after a build failure and start the build from scratch of first project]" \
  --revision"[Checkout a specific numbered revision]"":argument:" \
  "(--run-tests --no-run-tests)"{--run-tests,--no-run-tests}"[Built the projects with support for running their test suite]" \
  --self-update"[Update kde-builder itself (only for git-managed installations of kde-builder)]" \
  --set-project-option-value"[Override an option in your configuration file for a specific project]"":argument:" \
  --show-info"[Show tool information]" \
  --source-dir"[Directory that stores the KDE sources]"":argument:" \
  --source-when-start-program"[Source a file before starting the project]"":argument:" \
  "(--src-only -S -s --no-src)"{--src-only,-s}"[Only perform update source code]" \
  "(--stop-after --stop-before --to --until)"{--stop-after,--to}"[Stops just after the given project is reached]"":argument:" \
  "(--stop-after --stop-before --to --until)"{--stop-before,--until}"[Stops just before the given project is reached]"":::_kde-builder_projects_and_groups" \
  "(--stop-on-failure --no-stop-on-failure)"{--stop-on-failure,--no-stop-on-failure}"[Stops/Does not stop the build as soon as a project fails to build]" \
  --tag"[Download a specific release of a project]"":argument:" \
  --target"[Specifies custom build targets]"":argument:" \
  --taskset-cpu-list"[Limit the build/install process to certain CPU cores]"":argument:" \
  --uninstall"[Uninstalls the project]" \
  "(--use-clean-install --no-use-clean-install)"{--use-clean-install,--no-use-clean-install}"[Run make uninstall directly before running make install]" \
  "(--use-idle-io-priority --no-use-idle-io-priority)"{--use-idle-io-priority,--no-use-idle-io-priority}"[Use lower priority for disk and other I/O]" \
  "(--version -v)"{--version,-v}"[Script information]" \
  --run"[Start a program built with kde-builder]" \
  \
  "*:project or group: _kde-builder_projects_and_groups"
