title: How to parse a question mark as parameter in zsh/shell script?
body: <p>The parameters <code>--help</code>, <code>-h</code> or <code>-?</code> are common for showing information about how to use a program/script.</p>
  
  <p>So one may parse them like this:</p>
  
  <pre><code>#!/bin/sh
  # […]
  case "$1" in
      '' ) # no parameters
          echo "something missing here"
      --help|-?|-h ) # show help message
          show_help
          exit
          ;;
      *)
          # do something else…
          ;;
  esac
  </code></pre>
  
  <p>Passing <code>--help</code> and <code>-h</code> works. However when I pass <code>-?</code> to it, it fails with the error:</p>
  
  <blockquote>
    <p>zsh: no matches found: -?</p>
  </blockquote>
  
  <p>Now even when using a simple if loop it fails:</p>
  
  <pre><code>if [ "$1" = "-?" ]; then
      show_help
      exit
  fi
  </code></pre>
  
  <p>Note that passing <code>"-?"</code> or <code>'-?'</code> works, but that is silly and nobody does it.</p>
  
  <p>I also could not reproduce this in bash, only in zsh.</p>