much improvements and fixes

this commit includes a nice parsing of getopts by e36freak