Skip to content

Commit fad9076

Browse files
authored
Merge pull request #2336 from vishalsodani/master
Fix #2300
2 parents e343aa2 + 3345b00 commit fad9076

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/config.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ macro_rules! create_config {
518518

519519
pub fn print_docs() {
520520
use std::cmp;
521+
const HIDE_OPTIONS: [&str; 3] = ["verbose", "file_lines", "width_heuristics"];
521522
let max = 0;
522523
$( let max = cmp::max(max, stringify!($i).len()+1); )+
523524
let mut space_str = String::with_capacity(max);
@@ -527,20 +528,23 @@ macro_rules! create_config {
527528
println!("Configuration Options:");
528529
$(
529530
let name_raw = stringify!($i);
530-
let mut name_out = String::with_capacity(max);
531-
for _ in name_raw.len()..max-1 {
532-
name_out.push(' ')
531+
532+
if !HIDE_OPTIONS.contains(&name_raw) {
533+
let mut name_out = String::with_capacity(max);
534+
for _ in name_raw.len()..max-1 {
535+
name_out.push(' ')
536+
}
537+
name_out.push_str(name_raw);
538+
name_out.push(' ');
539+
println!("{}{} Default: {:?}",
540+
name_out,
541+
<$ty>::doc_hint(),
542+
$def);
543+
$(
544+
println!("{}{}", space_str, $dstring);
545+
)+
546+
println!();
533547
}
534-
name_out.push_str(name_raw);
535-
name_out.push(' ');
536-
println!("{}{} Default: {:?}",
537-
name_out,
538-
<$ty>::doc_hint(),
539-
$def);
540-
$(
541-
println!("{}{}", space_str, $dstring);
542-
)+
543-
println!();
544548
)+
545549
}
546550

0 commit comments

Comments
 (0)