// yum spec — Yellowdog Updater Modified (RPM package manager)
const completionSpec = {
  name: "yum",
  description: "RPM package manager (RHEL/CentOS)",
  subcommands: [
    { name: "install", description: "Install a package", args: { name: "package", isVariadic: true } },
    { name: "remove", description: "Remove a package", args: { name: "package", isVariadic: true } },
    { name: "update", description: "Update packages", args: { name: "package", isOptional: true, isVariadic: true } },
    { name: "upgrade", description: "Upgrade packages (same as update --obsoletes)", args: { name: "package", isOptional: true, isVariadic: true } },
    { name: "downgrade", description: "Downgrade a package", args: { name: "package", isVariadic: true } },
    { name: "list", description: "List packages", subcommands: [
      { name: "installed", description: "List installed packages" },
      { name: "available", description: "List available packages" },
      { name: "updates", description: "List packages with updates available" },
      { name: "extras", description: "List installed packages not in any repo" },
      { name: "obsoletes", description: "List obsoleting packages" },
      { name: "all", description: "List all packages" },
    ]},
    { name: "search", description: "Search package details for the given string", args: { name: "keyword", isVariadic: true } },
    { name: "info", description: "Display details about a package", args: { name: "package", isVariadic: true } },
    { name: "provides", description: "Find which package provides a file/feature", args: { name: "feature" } },
    { name: "clean", description: "Clean cached data", subcommands: [
      { name: "all", description: "Clean all cached data" },
      { name: "packages", description: "Clean cached packages" },
      { name: "metadata", description: "Clean cached metadata" },
      { name: "dbcache", description: "Clean cached db data" },
      { name: "expire-cache", description: "Expire the cache" },
    ]},
    { name: "makecache", description: "Generate the metadata cache" },
    { name: "groupinstall", description: "Install a package group", args: { name: "group" } },
    { name: "groupremove", description: "Remove a package group", args: { name: "group" } },
    { name: "grouplist", description: "List available package groups" },
    { name: "groupinfo", description: "Display details about a package group", args: { name: "group" } },
    { name: "check-update", description: "Check for available package updates" },
    { name: "reinstall", description: "Reinstall a package", args: { name: "package", isVariadic: true } },
    { name: "localinstall", description: "Install a local RPM package", args: { name: "rpm-file", template: "filepaths" } },
    { name: "deplist", description: "List package dependencies", args: { name: "package" } },
    { name: "repolist", description: "Display configured software repositories", subcommands: [
      { name: "all", description: "List all repos" },
      { name: "enabled", description: "List enabled repos" },
      { name: "disabled", description: "List disabled repos" },
    ]},
    { name: "repoinfo", description: "Display repository information" },
    { name: "history", description: "View and manage yum transaction history", subcommands: [
      { name: "list", description: "List transactions" },
      { name: "info", description: "Show transaction details", args: { name: "id" } },
      { name: "undo", description: "Undo a transaction", args: { name: "id" } },
      { name: "redo", description: "Redo a transaction", args: { name: "id" } },
    ]},
    { name: "autoremove", description: "Remove unneeded packages installed as dependencies" },
  ],
  options: [
    { name: "-y", description: "Answer yes to all questions" },
    { name: "-q", description: "Quiet operation" },
    { name: "-v", description: "Verbose operation" },
    { name: "--enablerepo", description: "Enable a repository", args: { name: "repo" } },
    { name: "--disablerepo", description: "Disable a repository", args: { name: "repo" } },
    { name: "--nogpgcheck", description: "Disable GPG signature checking" },
    { name: "--skip-broken", description: "Skip packages with dependency problems" },
    { name: "--showduplicates", description: "Show duplicate packages in repos" },
    { name: "--installroot", description: "Set install root", args: { name: "path", template: "folders" } },
    { name: "-C", description: "Run entirely from system cache" },
    { name: "--security", description: "Include only security-related packages" },
    { name: ["-h", "--help"], description: "Show help" },
  ],
};

export default completionSpec;
