mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-29 07:03:54 +00:00
Hide the group by default
This commit is contained in:
parent
0dd74a022f
commit
7091a42ab8
17
options.rs
17
options.rs
@ -13,7 +13,7 @@ pub struct Options {
|
|||||||
pub sortField: SortField,
|
pub sortField: SortField,
|
||||||
pub reverse: bool,
|
pub reverse: bool,
|
||||||
pub dirs: Vec<String>,
|
pub dirs: Vec<String>,
|
||||||
pub columns: ~[Column],
|
pub columns: Vec<Column>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SortField {
|
impl SortField {
|
||||||
@ -32,6 +32,7 @@ impl Options {
|
|||||||
let opts = ~[
|
let opts = ~[
|
||||||
getopts::optflag("a", "all", "show dot-files"),
|
getopts::optflag("a", "all", "show dot-files"),
|
||||||
getopts::optflag("b", "binary", "use binary prefixes in file sizes"),
|
getopts::optflag("b", "binary", "use binary prefixes in file sizes"),
|
||||||
|
getopts::optflag("g", "group", "show group as well as user"),
|
||||||
getopts::optflag("r", "reverse", "reverse order of files"),
|
getopts::optflag("r", "reverse", "reverse order of files"),
|
||||||
getopts::optopt("s", "sort", "field to sort by", "WORD"),
|
getopts::optopt("s", "sort", "field to sort by", "WORD"),
|
||||||
];
|
];
|
||||||
@ -48,14 +49,20 @@ impl Options {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn columns(matches: getopts::Matches) -> ~[Column] {
|
fn columns(matches: getopts::Matches) -> Vec<Column> {
|
||||||
return ~[
|
let mut columns = vec![
|
||||||
Permissions,
|
Permissions,
|
||||||
FileSize(matches.opt_present("binary")),
|
FileSize(matches.opt_present("binary")),
|
||||||
User,
|
User,
|
||||||
Group,
|
|
||||||
FileName,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if matches.opt_present("group") {
|
||||||
|
columns.push(Group);
|
||||||
|
}
|
||||||
|
|
||||||
|
columns.push(FileName);
|
||||||
|
|
||||||
|
return columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show(&self, f: &File) -> bool {
|
fn show(&self, f: &File) -> bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user