@@ -49,6 +49,7 @@ struct Column<'a> {
49
49
path : String ,
50
50
value : RefCell < String > ,
51
51
attr : Option < & ' a str > ,
52
+ hide : bool ,
52
53
filter : Option < Regex > ,
53
54
convert : Option < & ' a str > ,
54
55
find : Option < & ' a str > ,
@@ -127,6 +128,7 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, filemode: &str, skip: Opt
127
128
Some ( add_table ( & path, Some ( file) , filemode, skip, col[ "cols" ] . as_vec ( ) . expect ( "Subtable 'cols' entry is not an array" ) ) )
128
129
}
129
130
} ;
131
+ let hide = col[ "hide" ] . as_bool ( ) . unwrap_or ( false ) ;
130
132
let filter: Option < Regex > = col[ "filt" ] . as_str ( ) . map ( |str| Regex :: new ( str) . expect ( "Invalid regex in 'filt' entry in configuration file" ) ) ;
131
133
let attr = col[ "attr" ] . as_str ( ) ;
132
134
let convert = col[ "conv" ] . as_str ( ) ;
@@ -149,7 +151,7 @@ fn add_table<'a>(rowpath: &str, outfile: Option<&str>, filemode: &str, skip: Opt
149
151
}
150
152
}
151
153
152
- let column = Column { name : name. to_string ( ) , path, value : RefCell :: new ( String :: new ( ) ) , attr, filter, convert, find, replace, consol, subtable } ;
154
+ let column = Column { name : name. to_string ( ) , path, value : RefCell :: new ( String :: new ( ) ) , attr, hide , filter, convert, find, replace, consol, subtable } ;
153
155
table. columns . push ( column) ;
154
156
}
155
157
table
@@ -390,7 +392,7 @@ fn main() -> std::io::Result<()> {
390
392
391
393
// Now write out the other column values
392
394
for i in 0 ..table. columns . len ( ) {
393
- if table. columns [ i] . subtable . is_some ( ) { continue ; }
395
+ if table. columns [ i] . hide || table . columns [ i ] . subtable . is_some ( ) { continue ; }
394
396
if i > 0 { table. write ( "\t " ) ; }
395
397
if table. columns [ i] . value . borrow ( ) . is_empty ( ) { table. write ( "\\ N" ) ; }
396
398
else {
0 commit comments