Add support for the --detach flag