const ISSUE_HELP: &str = "\
Usage: gotcha issue SUBCOMMAND

Subcommands:
  list [OWNER/REPOSITORY] [OPTIONS]
                                  List and filter issues
  show INDEX [OWNER/REPOSITORY]    Show an issue
  create [OWNER/REPOSITORY]        Create from CreateIssueOption YAML on stdin
  edit INDEX... [OWNER/REPOSITORY] Edit issues from EditIssueOption YAML on stdin
  close INDEX... [OWNER/REPOSITORY]
                                  Close one or more issues
  reopen INDEX... [OWNER/REPOSITORY]
                                  Reopen one or more issues
  delete INDEX [OWNER/REPOSITORY]  Delete an issue
  comments INDEX [OWNER/REPOSITORY]
                                  List comments
  comment INDEX [OWNER/REPOSITORY] Add a comment read as text from stdin";

const MILESTONE_HELP: &str = "\
Usage: gotcha milestone SUBCOMMAND

Subcommands:
  list [OWNER/REPOSITORY]       List milestones
  show ID [OWNER/REPOSITORY]    Show a milestone
  create [OWNER/REPOSITORY]     Create from CreateMilestoneOption YAML on stdin
  edit ID [OWNER/REPOSITORY]    Edit from EditMilestoneOption YAML on stdin
  delete ID [OWNER/REPOSITORY]  Delete a milestone";

const PULL_HELP: &str = "\
Usage: gotcha pull SUBCOMMAND

Subcommands:
  list [OWNER/REPOSITORY]          List pull requests
  show INDEX [OWNER/REPOSITORY]    Show a pull request
  create [OWNER/REPOSITORY]        Create from CreatePullRequestOption YAML on stdin
  edit INDEX [OWNER/REPOSITORY]    Edit from EditPullRequestOption YAML on stdin
  merge INDEX [OWNER/REPOSITORY]   Merge from MergePullRequestOption YAML on stdin
  commits INDEX [OWNER/REPOSITORY] List commits
  files INDEX [OWNER/REPOSITORY]   List changed files
  reviews INDEX [OWNER/REPOSITORY] List reviews";

pub fn domain_help(domain: &str) -> Option<&'static str> {
    match domain {
        "issue" => Some(ISSUE_HELP),
        "milestone" => Some(MILESTONE_HELP),
        "pull" => Some(PULL_HELP),
        _ => None,
    }
}

pub fn subcommand_help(domain: &str, command: &str) -> Option<&'static str> {
    match (domain, command) {
        ("issue", "list") => Some(
            "Usage: gotcha issue list [OWNER/REPOSITORY] [OPTIONS]\n\nOptions:\n  --state open|closed|all\n  -K, --kind issues|pulls|all\n  -k, --keyword TEXT\n  -L, --labels NAMES\n  -m, --milestones NAMES\n  -A, --author USER\n  -a, --assignee USER\n  -M, --mentions USER\n  -F, --from TIMESTAMP\n  -u, --until TIMESTAMP\n  -p, --page NUMBER\n      --limit NUMBER",
        ),
        ("issue", "show") => Some("Usage: gotcha issue show INDEX [OWNER/REPOSITORY]"),
        ("issue", "create") => Some(
            "Usage: gotcha issue create [OWNER/REPOSITORY] < issue.yaml\n\nReads CreateIssueOption YAML from stdin. label_names and milestone_name accept display names, for example:\n  title: Fix the bug\n  body: Reproduction steps\n  label_names: [bug, critical]\n  milestone_name: Version 1.0",
        ),
        ("issue", "edit") => Some(
            "Usage: gotcha issue edit INDEX... [OWNER/REPOSITORY] < issue.yaml\n\nReads EditIssueOption YAML from stdin and applies it to every index. milestone_name resolves a display name; add_labels and remove_labels accept label names; add_assignees adds users without replacing existing assignees.",
        ),
        ("issue", "close") => Some("Usage: gotcha issue close INDEX... [OWNER/REPOSITORY]"),
        ("issue", "reopen") => Some("Usage: gotcha issue reopen INDEX... [OWNER/REPOSITORY]"),
        ("issue", "delete") => Some("Usage: gotcha issue delete INDEX [OWNER/REPOSITORY]"),
        ("issue", "comments") => Some("Usage: gotcha issue comments INDEX [OWNER/REPOSITORY]"),
        ("issue", "comment") => Some(
            "Usage: gotcha issue comment INDEX [OWNER/REPOSITORY] < comment.txt\n\nReads the comment body as text from stdin.",
        ),
        ("milestone", "list") => Some("Usage: gotcha milestone list [OWNER/REPOSITORY]"),
        ("milestone", "show") => Some("Usage: gotcha milestone show ID [OWNER/REPOSITORY]"),
        ("milestone", "create") => Some(
            "Usage: gotcha milestone create [OWNER/REPOSITORY] < milestone.yaml\n\nReads CreateMilestoneOption YAML from stdin, for example:\n  title: Version 1.0\n  due_on: 2026-09-01T00:00:00Z",
        ),
        ("milestone", "edit") => Some(
            "Usage: gotcha milestone edit ID [OWNER/REPOSITORY] < milestone.yaml\n\nReads EditMilestoneOption YAML from stdin.",
        ),
        ("milestone", "delete") => Some("Usage: gotcha milestone delete ID [OWNER/REPOSITORY]"),
        ("pull", "list") => Some("Usage: gotcha pull list [OWNER/REPOSITORY]"),
        ("pull", "show") => Some("Usage: gotcha pull show INDEX [OWNER/REPOSITORY]"),
        ("pull", "create") => Some(
            "Usage: gotcha pull create [OWNER/REPOSITORY] < pull.yaml\n\nReads CreatePullRequestOption YAML from stdin, for example:\n  title: Add feature\n  head: feature\n  base: main",
        ),
        ("pull", "edit") => Some(
            "Usage: gotcha pull edit INDEX [OWNER/REPOSITORY] < pull.yaml\n\nReads EditPullRequestOption YAML from stdin.",
        ),
        ("pull", "merge") => Some(
            "Usage: gotcha pull merge INDEX [OWNER/REPOSITORY] < merge.yaml\n\nReads MergePullRequestOption YAML from stdin, for example:\n  Do: squash\n  delete_branch_after_merge: true",
        ),
        ("pull", "commits") => Some("Usage: gotcha pull commits INDEX [OWNER/REPOSITORY]"),
        ("pull", "files") => Some("Usage: gotcha pull files INDEX [OWNER/REPOSITORY]"),
        ("pull", "reviews") => Some("Usage: gotcha pull reviews INDEX [OWNER/REPOSITORY]"),
        _ => None,
    }
}
