From 3345b00952251e7b2141c1d064ec4dc988adcb50 Mon Sep 17 00:00:00 2001 From: Vishal Sodani Date: Thu, 4 Jan 2018 09:37:08 +0530 Subject: [PATCH] Fix #2300 --- src/config.rs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/config.rs b/src/config.rs index fb0cdf6aaf2..cfbc1e181bf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -518,6 +518,7 @@ macro_rules! create_config { pub fn print_docs() { use std::cmp; + const HIDE_OPTIONS: [&str; 3] = ["verbose", "file_lines", "width_heuristics"]; let max = 0; $( let max = cmp::max(max, stringify!($i).len()+1); )+ let mut space_str = String::with_capacity(max); @@ -527,20 +528,23 @@ macro_rules! create_config { println!("Configuration Options:"); $( let name_raw = stringify!($i); - let mut name_out = String::with_capacity(max); - for _ in name_raw.len()..max-1 { - name_out.push(' ') + + if !HIDE_OPTIONS.contains(&name_raw) { + let mut name_out = String::with_capacity(max); + for _ in name_raw.len()..max-1 { + name_out.push(' ') + } + name_out.push_str(name_raw); + name_out.push(' '); + println!("{}{} Default: {:?}", + name_out, + <$ty>::doc_hint(), + $def); + $( + println!("{}{}", space_str, $dstring); + )+ + println!(); } - name_out.push_str(name_raw); - name_out.push(' '); - println!("{}{} Default: {:?}", - name_out, - <$ty>::doc_hint(), - $def); - $( - println!("{}{}", space_str, $dstring); - )+ - println!(); )+ }