Factored common command-line initialization into util.