title: Argument is empty using getopts
body: <p>I want to be able to run a script like <code>run.sh test -a</code> but my arguments are empty.</p>
  <pre class="lang-sh prettyprint-override"><code>#!/bin/bash
  
  function install() {
      echo &quot;Installing $1&quot;
  }
  
  while getopts &quot;ab&quot; ARG; do
    case &quot;$ARG&quot; in
      a) install
         echo &quot;Setting up A&quot; ;;
      b) install
         echo &quot;Setting up B&quot; ;;
      *​) echo &quot;argument missing&quot; ;;
    esac
  done
  </code></pre>
  <p>My expected output would be if I run <code>run.sh test -a</code>:</p>
  <pre><code>Installing test
  Setting up A
  </code></pre>
  <p>However there is no output returned. If I run <code>run.sh -a</code>, I get:</p>
  <pre><code>Installing
  Setting up A
  </code></pre>