initial version: get it compile, add getopt