Long options with an equal sign (--xxx=yyy) don't work

the variable $opt was being overridden, which prevented $optarg to get
the right value. because of this, arguments of the form --xxx=yyy are
not working (without the equal sign, e.g. --xxx yyy still worked)

small amendments for form only by Gabriel Filion <gabster@lelutin.ca>