-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abcd773
commit b30255e
Showing
7 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use clap::Parser; | ||
use eyre::Result; | ||
use log::error; | ||
|
||
use crate::{cache, cli::LocalFilesArgs}; | ||
|
||
#[derive(Debug, Parser)] | ||
pub struct ListCommandArgs { | ||
#[clap(flatten)] | ||
file_args: LocalFilesArgs, | ||
/// the ID of the dynalist.io document. | ||
#[clap(long, env)] | ||
pub document_id: String, | ||
} | ||
|
||
pub fn run_command(args: ListCommandArgs) -> Result<()> { | ||
let cache_path = args.file_args.get_cache_file_path(&args.document_id)?; | ||
let booksmarks = cache::read_from_cache(&cache_path); | ||
|
||
match booksmarks { | ||
Ok(bookmarks) => { | ||
for b in bookmarks { | ||
println!("{}\t{}", b.0, b.1); | ||
} | ||
} | ||
Err(err) => { | ||
error!( | ||
"failed to read local cache at {}: {}", | ||
&cache_path.to_str().unwrap_or_default(), | ||
err | ||
); | ||
} | ||
}; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod clean; | ||
pub mod list; | ||
pub mod rofi; | ||
pub mod sync; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters