mirror of
https://github.com/icewind1991/zox
synced 2026-06-03 18:34:07 +02:00
sort output of -l
This commit is contained in:
parent
982966d023
commit
b783a8792d
1 changed files with 9 additions and 9 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -170,11 +170,6 @@ fn main() -> Result<(), MainError> {
|
|||
if let Ok(history) = history_result {
|
||||
let matches = history.filter(|item| item.matches(&args.filter));
|
||||
|
||||
if args.list {
|
||||
for item in matches {
|
||||
println!("{:<11}{}", item.get_sort(args.sort, now), item.path);
|
||||
}
|
||||
} else {
|
||||
let mut matches: Vec<History> = matches.collect();
|
||||
matches.sort_by(
|
||||
|a, b| match a.get_sort(args.sort, now) - b.get_sort(args.sort, now) {
|
||||
|
|
@ -184,6 +179,11 @@ fn main() -> Result<(), MainError> {
|
|||
},
|
||||
);
|
||||
|
||||
if args.list {
|
||||
for item in matches {
|
||||
println!("{:<11}{}", item.get_sort(args.sort, now), item.path);
|
||||
}
|
||||
} else {
|
||||
if let Some(first) = matches.first() {
|
||||
println!("{}", first.path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue