Implement --foreground CLI option