diff options
| author | lukeflo | 2024-11-22 14:04:42 +0100 |
|---|---|---|
| committer | lukeflo | 2024-11-22 14:04:42 +0100 |
| commit | e5274a2e0c3c6ba62d12420d487e3725e154cee4 (patch) | |
| tree | 59300d8c6586b878584bb61b8dbe2ceba2c14e6e /src/bibiman.rs | |
| parent | 2621a347a0e6f2a2e1b625ca26aad3a0cf8e58f5 (diff) | |
| download | bibiman-e5274a2e0c3c6ba62d12420d487e3725e154cee4.tar.gz bibiman-e5274a2e0c3c6ba62d12420d487e3725e154cee4.zip | |
open multiple files: per CLI possible
Diffstat (limited to 'src/bibiman.rs')
| -rw-r--r-- | src/bibiman.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs index e65d5bc..4d0aa60 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -55,7 +55,7 @@ pub enum FormerArea { #[derive(Debug)] pub struct Bibiman { // main bib file - pub main_bibfile: PathBuf, + pub main_bibfiles: Vec<PathBuf>, // main bibliography pub main_biblio: BibiSetup, // search struct: @@ -77,14 +77,14 @@ pub struct Bibiman { impl Bibiman { // Constructs a new instance of [`App`]. pub fn new(args: CLIArgs) -> Result<Self> { - let main_bibfile = args.bibfilearg; - let main_biblio = BibiSetup::new(&main_bibfile); + let main_bibfiles = args.bibfilearg; + let main_biblio = BibiSetup::new(&main_bibfiles); let tag_list = TagList::new(main_biblio.keyword_list.clone()); let search_struct = BibiSearch::default(); let entry_table = EntryTable::new(&main_biblio.entry_list); let current_area = CurrentArea::EntryArea; Ok(Self { - main_bibfile, + main_bibfiles, main_biblio, tag_list, search_struct, @@ -123,7 +123,7 @@ impl Bibiman { } pub fn update_lists(&mut self) { - self.main_biblio = BibiSetup::new(&self.main_bibfile); + self.main_biblio = BibiSetup::new(&self.main_bibfiles); self.tag_list = TagList::new(self.main_biblio.keyword_list.clone()); self.entry_table = EntryTable::new(&self.main_biblio.entry_list); } @@ -306,7 +306,9 @@ impl Bibiman { .citekey; // create independent copy of citekey for finding entry after updating list let saved_key = citekey.to_owned(); - let filepath = self.main_bibfile.as_os_str(); + // TODO: Only for testing purposes, needs better logic to find correct file + // when using multi file approach + let filepath = self.main_bibfiles[0].as_os_str(); let filecontent: &str = &self.main_biblio.bibfilestring; let mut line_count = 0; |
