a general option parser interface