@@ -267,19 +267,19 @@ impl View {
267
267
}
268
268
else {
269
269
let details = Details {
270
- columns : try!( Columns :: deduce ( matches) ) ,
271
- header : matches. opt_present ( "header" ) ,
272
- recurse : dir_action. recurse_options ( ) . map ( |o| ( o, filter) ) ,
273
- xattr : Attribute :: feature_implemented ( ) && matches. opt_present ( "extended" ) ,
274
- colours : if dimensions ( ) . is_some ( ) { Colours :: colourful ( ) } else { Colours :: plain ( ) } ,
270
+ columns : Some ( try!( Columns :: deduce ( matches) ) ) ,
271
+ header : matches. opt_present ( "header" ) ,
272
+ recurse : dir_action. recurse_options ( ) . map ( |o| ( o, filter) ) ,
273
+ xattr : Attribute :: feature_implemented ( ) && matches. opt_present ( "extended" ) ,
274
+ colours : if dimensions ( ) . is_some ( ) { Colours :: colourful ( ) } else { Colours :: plain ( ) } ,
275
275
} ;
276
276
277
277
Ok ( details)
278
278
}
279
279
} ;
280
280
281
281
let long_options_scan = || {
282
- for option in & [ "binary" , "bytes" , "inode" , "links" , "header" , "blocks" , "time" , "tree" , " group" ] {
282
+ for option in & [ "binary" , "bytes" , "inode" , "links" , "header" , "blocks" , "time" , "group" ] {
283
283
if matches. opt_present ( option) {
284
284
return Err ( Useless ( option, false , "long" ) ) ;
285
285
}
@@ -288,7 +288,7 @@ impl View {
288
288
if cfg ! ( feature="git" ) && matches. opt_present ( "git" ) {
289
289
Err ( Useless ( "git" , false , "long" ) )
290
290
}
291
- else if matches. opt_present ( "level" ) && !matches. opt_present ( "recurse" ) {
291
+ else if matches. opt_present ( "level" ) && !matches. opt_present ( "recurse" ) && !matches . opt_present ( "tree" ) {
292
292
Err ( Useless2 ( "level" , "recurse" , "tree" ) )
293
293
}
294
294
else if Attribute :: feature_implemented ( ) && matches. opt_present ( "extended" ) {
@@ -313,6 +313,17 @@ impl View {
313
313
Ok ( View :: Lines ( lines) )
314
314
}
315
315
}
316
+ else if matches. opt_present ( "tree" ) {
317
+ let details = Details {
318
+ columns : None ,
319
+ header : false ,
320
+ recurse : dir_action. recurse_options ( ) . map ( |o| ( o, filter) ) ,
321
+ xattr : false ,
322
+ colours : if dimensions ( ) . is_some ( ) { Colours :: colourful ( ) } else { Colours :: plain ( ) } ,
323
+ } ;
324
+
325
+ Ok ( View :: Details ( details) )
326
+ }
316
327
else {
317
328
let grid = Grid {
318
329
across : matches. opt_present ( "across" ) ,
0 commit comments