getopt: optimize previous patch