[PATCHv2] Daemon.cpp: remove getopt and use parse_opts instead