detect -daemon being passed, and daemonize to the background when it is passed