# Bash completion for xsec_policy_cli
# Generated by Cyclopts

_xsec_policy_cli() {
  local cur prev

  cur="${COMP_WORDS[COMP_CWORD]}"
  prev="${COMP_WORDS[COMP_CWORD-1]}"

  # Build list of options that take values (to skip their arguments)
  local options_with_values='--format --input --mode --output --pager --policy --policy-id --session-id --shell --target'

  # Build list of all valid command names (to distinguish from positionals)
  local all_commands='apply backup check close commit completion create discard events export import install list monitor params policy pre-check profile resources rollback session show status target validate verify'

  # Detect command path by collecting valid command words only
  local -a cmd_path=()
  local i skip_next=0
  for ((i=1; i<COMP_CWORD; i++)); do
    local word="${COMP_WORDS[i]}"
    if [[ $skip_next -eq 1 ]]; then
      skip_next=0
      continue
    fi
    if [[ $word =~ ^- ]]; then
      # Check if this option takes a value
      if [[ " $options_with_values " =~ " $word " ]]; then
        skip_next=1
      fi
    else
      # Non-option word - only add to cmd_path if it's a valid command
      if [[ " $all_commands " =~ " $word " ]]; then
        cmd_path+=("$word")
      fi
    fi
  done

  # Count positionals (non-option words after command path)
  local positional_count=0
  local cmd_path_len=${#cmd_path[@]}
  skip_next=0
  local cmd_depth=0
  for ((i=1; i<COMP_CWORD; i++)); do
    local word="${COMP_WORDS[i]}"
    if [[ $skip_next -eq 1 ]]; then
      skip_next=0
      continue
    fi
    if [[ $word =~ ^- ]]; then
      if [[ " $options_with_values " =~ " $word " ]]; then
        skip_next=1
      fi
    else
      # Non-option word
      if [[ $cmd_depth -lt $cmd_path_len ]]; then
        # Still in command path
        ((cmd_depth++))
      else
        # Past command path, this is a positional
        ((positional_count++))
      fi
    fi
  done

  # Determine command level and generate completions
  case "${#cmd_path[@]}" in
    0)
      if [[ ${cur} == -* ]]; then
        local -a _c=("--help" "-h" "--version")
        COMPREPLY=()
        for _x in "${_c[@]}"; do
          [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
        done
      else
        local -a _c=("resources" "session" "target" "profile" "policy" "events" "completion" "check" "list")
        COMPREPLY=()
        for _x in "${_c[@]}"; do
          [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
        done
      fi
      ;;
    1)
      case "${cmd_path[@]}" in
        "check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "completion")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("install")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "events")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("list")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "policy")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("params" "list" "show" "check" "status" "monitor" "events")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "profile")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("list" "show" "check")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "resources")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("check")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "session")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("params" "create" "list" "status" "pre-check" "backup" "apply" "verify" "commit" "rollback" "monitor" "close" "discard" "events")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "target")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("list" "show" "check")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        *)
          ;;
      esac
      ;;
    2)
      case "${cmd_path[@]}" in
        "completion install")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--shell" "--mode" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --shell)
                local -a _c=("bash" "zsh" "fish")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              --mode)
                local -a _c=("static" "dynamic")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "events list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--session-id" "--policy-id" "--pager" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --session-id)
                COMPREPLY=()
                ;;
              --policy-id)
                COMPREPLY=()
                ;;
              --pager)
                local -a _c=("auto" "always" "never")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "policy check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "policy events")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--pager" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --pager)
                local -a _c=("auto" "always" "never")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "policy list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "policy monitor")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "policy params")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("show" "export" "validate" "import")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "policy show")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "policy status")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "profile check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "profile list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "profile show")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "resources check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session apply")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session backup")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session close")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--no-rollback" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session commit")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session create")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--target" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --target)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session discard")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session events")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--pager" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --pager)
                local -a _c=("auto" "always" "never")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--pager" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --pager)
                local -a _c=("auto" "always" "never")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session monitor")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session params")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local -a _c=("show" "export" "validate" "import")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          fi
          ;;
        "session pre-check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session rollback")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session status")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "session verify")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "target check")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "target list")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        "target show")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            COMPREPLY=()
          fi
          ;;
        *)
          ;;
      esac
      ;;
    3)
      case "${cmd_path[@]}" in
        "policy params export")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--output" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --output)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "policy params import")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--input" "--dry-run" "--yes" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --input)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "policy params show")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--format" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --format)
                local -a _c=("table" "toml" "json")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "policy params validate")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--input" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --input)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session params export")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--output" "--policy" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --output)
                COMPREPLY=()
                ;;
              --policy)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session params import")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--input" "--dry-run" "--yes" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --input)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session params show")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--policy" "--format" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --policy)
                COMPREPLY=()
                ;;
              --format)
                local -a _c=("table" "toml" "json")
                COMPREPLY=()
                for _x in "${_c[@]}"; do
                  [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
                done
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        "session params validate")
          if [[ ${cur} == -* ]]; then
            local -a _c=("--input" "--help" "-h" "--version")
            COMPREPLY=()
            for _x in "${_c[@]}"; do
              [[ "$_x" == "${cur}"* ]] && COMPREPLY+=("$_x")
            done
          else
            local _value_prev="${prev}"
            if [[ "$_value_prev" == "=" && $COMP_CWORD -ge 2 ]]; then
              _value_prev="${COMP_WORDS[COMP_CWORD-2]}"
            fi
            case "$_value_prev" in
              --input)
                COMPREPLY=()
                ;;
              *)
                COMPREPLY=()
                ;;
            esac
          fi
          ;;
        *)
          ;;
      esac
      ;;
    *)
      ;;
  esac
}

complete -F _xsec_policy_cli xsec_policy_cli
