mirror of
https://github.com/icewind1991/zox
synced 2026-06-03 18:34:07 +02:00
dont jump to home if not match
This commit is contained in:
parent
9a482b533f
commit
38f984d2de
2 changed files with 9 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ use main_error::MainError;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::cmp::Ordering;
|
||||
use std::io::{stdout, Write};
|
||||
use std::process::exit;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
|
|
@ -237,6 +238,8 @@ fn main() -> Result<(), MainError> {
|
|||
} else {
|
||||
if let Some(first) = matches.first() {
|
||||
println!("{}", first.path);
|
||||
} else {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7
z.fish
7
z.fish
|
|
@ -3,5 +3,10 @@ function addzhist --on-variable PWD
|
|||
end
|
||||
|
||||
function z -d "Jump to a recent directory."
|
||||
cd (zox $argv)
|
||||
set -l target (zox $argv)
|
||||
if test $status -eq 0
|
||||
cd $target
|
||||
else
|
||||
return $stats
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue