Some refactor to detect --interactive mode.