bookmarks can be added with relative paths now
This commit is contained in:
+9
-5
@@ -151,11 +151,15 @@ fn list_bookmarks(config: &Config, bookmarks: &mut Bookmarks) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn add_bookmarks(args: &BookmarkSubArgs, config: &Config, bookmarks: &mut Bookmarks) -> Result<()> {
|
fn add_bookmarks(args: &BookmarkSubArgs, config: &Config, bookmarks: &mut Bookmarks) -> Result<()> {
|
||||||
if args.path.is_none() {
|
let mut path = match args.path.clone() {
|
||||||
return Err(Error::other("-- missing path argument"));
|
Some(value) => value,
|
||||||
} else {
|
None => return Err(Error::other("-- missing path argument")),
|
||||||
bookmarks.add_bookmark(&args.name, &args.path.clone().unwrap())?;
|
};
|
||||||
}
|
path = match path.canonicalize() {
|
||||||
|
Ok(value) => value,
|
||||||
|
Err(error) => return Err(Error::other(error.to_string())),
|
||||||
|
};
|
||||||
|
bookmarks.add_bookmark(&args.name, &path)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user