これでいいな。
$ getopt --options 'a,b,c' --longoptions 'foo:,bar' -- -a --foo foo1 file1 -b file2 -c --bar