diff options
| author | lukeflo | 2024-11-25 11:49:25 +0100 |
|---|---|---|
| committer | lukeflo | 2024-11-25 11:49:25 +0100 |
| commit | bfe4624508f893fdf14a94fffbe4377aabf8c90f (patch) | |
| tree | f09ffe6e083b9f9d78afc68a57ec2078b7379120 /src/bibiman.rs | |
| parent | b638d1bb534ef165864bfe54405c73a0e1bb0385 (diff) | |
| download | bibiman-bfe4624508f893fdf14a94fffbe4377aabf8c90f.tar.gz bibiman-bfe4624508f893fdf14a94fffbe4377aabf8c90f.zip | |
handling of errors and ui for multi file case
Diffstat (limited to 'src/bibiman.rs')
| -rw-r--r-- | src/bibiman.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs index b8f04c8..bba3eec 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -78,7 +78,7 @@ impl Bibiman { // Constructs a new instance of [`App`]. pub fn new(args: &CLIArgs) -> Result<Self> { // let main_bibfiles = args.fileargs.clone(); - let main_biblio = BibiSetup::new(&args.fileargs); + let main_biblio = BibiSetup::new(&args.files); let tag_list = TagList::new(main_biblio.keyword_list.clone()); let search_struct = BibiSearch::default(); let entry_table = EntryTable::new(&main_biblio.entry_list); @@ -123,7 +123,7 @@ impl Bibiman { } pub fn update_lists(&mut self, args: &CLIArgs) { - self.main_biblio = BibiSetup::new(&args.fileargs); + self.main_biblio = BibiSetup::new(&args.files); self.tag_list = TagList::new(self.main_biblio.keyword_list.clone()); self.entry_table = EntryTable::new(&self.main_biblio.entry_list); } @@ -312,17 +312,17 @@ impl Bibiman { // Check if multiple files were passed to bibiman and // return the correct file path - let filepath = if args.fileargs.len() == 1 { - args.fileargs.first().unwrap().as_os_str() + let filepath = if args.files.len() == 1 { + args.files.first().unwrap().as_os_str() } else { let mut idx = 0; - for f in &args.fileargs { + for f in &args.files { if search::search_pattern_in_file(&citekey_pattern, &f).is_some() { break; } idx += 1; } - args.fileargs[idx].as_os_str() + args.files[idx].as_os_str() }; let filecontent = fs::read_to_string(&filepath).unwrap(); |
