Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Help overriding a single flag’s completion action



> Could you advise on the correct approach?

I tried zstyle first but never found the right syntax; using compdef with a helper function worked.

_fab_wrap() {
  if ((CURRENT > 1)) && [[ ${words[CURRENT - 1]} =~ '-m|--model' ]]; then
    # Minimal Example
    local -a my_itmes=(
      'alpha:100k'
      'beta:20k'
      'gamma:4k'
    )
    _describe '' my_itmes
    return 0
  fi
  _fabric-ai "$@"
}

compdef _fab_wrap fabric-ai






Messages sorted by: Reverse Date, Date, Thread, Author