port to golang
replace go's builtin flag package by POSIX-compliant one