title: How Can I add a flag to alias?
body: <p>I want to add a flag to alias, in my case I want do it for <a href="https://github.com/sharkdp/bat" rel="nofollow noreferrer">bat</a>. e.g.</p>
  <pre><code>mybat -a = 'bat --paging=always [file e.g .zshrc]'
  mybat -n = 'bat --paging=never [file e.g .zshrc] '
  </code></pre>
  <p>I also wrote and tested the following code, but it did not work:</p>
  <pre><code>mybat() {
    local OPTIND value
    while getopts &quot;:an&quot; option; do
      case $option in
        a) value=never ;;
        n) value=always ;;
        ?) echo &quot;invalid option: $OPTARG&quot;; return 1 ;;
      esac
    done
    bat --paging=$value
  }
  </code></pre>
  <p>Anyone have an idea?</p>