title: Correct usage of bash getopts using long options
body: <p>I have written below code for using long options with <code>getopts</code>, but it doesn't work (arguments have no effect on values of the variables). What is the correct syntax?</p>
  
  <pre><code>while getopts "c:(mode)d:(file1)e:(file2)" opt; do
    case $opt in
    -c|--mode)
        mode=$OPTARG
        ;;  
    -d|--file1)
        file1=$OPTARG
        ;;  
    -e|--file2)
        file2=$OPTARG
        ;;  
    esac
  done
  </code></pre>