[gui] Handle defaults and command line options in a separate function.