From ffae98ac0a032e1f0538de616ba60532419d45f0 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 5 Jun 2015 18:04:25 -0400 Subject: [PATCH] feature #3826: listconfig configurable with env Env variable ONE_LISTCONF, can be overridden with --listconf --- src/cli/cli_helper.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index 1cbe37dfa7..553360d51c 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -329,10 +329,15 @@ module CLIHelper default = config.delete(:default) default_conf = config.delete(:default_conf) || {} + listconf = options[:listconf] - listconf = default_conf[options[:listconf].to_sym] + listconf = default_conf[listconf.to_sym] if listconf - if options[:listconf] && listconf + if !listconf && ENV['ONE_LISTCONF'] + listconf = default_conf[ENV['ONE_LISTCONF'].to_sym] + end + + if listconf @default_columns = listconf else @default_columns = default unless default.empty?