getopt and tl input written (not tested)