diff options
| author | lukeflo | 2024-11-23 01:03:00 +0100 |
|---|---|---|
| committer | lukeflo | 2024-11-23 01:03:00 +0100 |
| commit | 56ce42228ca48c3d940ea01bce6c11bdfb498bce (patch) | |
| tree | 10db6a6e1ac810263948e369db33f568130d541a /src/bibiman.rs | |
| parent | e354e97facdf61abb20a06f5bae2bac5e86c2d62 (diff) | |
| download | bibiman-56ce42228ca48c3d940ea01bce6c11bdfb498bce.tar.gz bibiman-56ce42228ca48c3d940ea01bce6c11bdfb498bce.zip | |
rename files arg field, start rewriting run_editor fn
Diffstat (limited to 'src/bibiman.rs')
| -rw-r--r-- | src/bibiman.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bibiman.rs b/src/bibiman.rs index 3da0a24..88019d6 100644 --- a/src/bibiman.rs +++ b/src/bibiman.rs @@ -76,8 +76,8 @@ pub struct Bibiman { impl Bibiman { // Constructs a new instance of [`App`]. pub fn new(args: &CLIArgs) -> Result<Self> { - // let main_bibfiles = args.pos_args.clone(); - let main_biblio = BibiSetup::new(&args.pos_args); + // let main_bibfiles = args.fileargs.clone(); + let main_biblio = BibiSetup::new(&args.fileargs); let tag_list = TagList::new(main_biblio.keyword_list.clone()); let search_struct = BibiSearch::default(); let entry_table = EntryTable::new(&main_biblio.entry_list); @@ -122,7 +122,7 @@ impl Bibiman { } pub fn update_lists(&mut self, args: &CLIArgs) { - self.main_biblio = BibiSetup::new(&args.pos_args); + self.main_biblio = BibiSetup::new(&args.fileargs); self.tag_list = TagList::new(self.main_biblio.keyword_list.clone()); self.entry_table = EntryTable::new(&self.main_biblio.entry_list); } @@ -307,7 +307,10 @@ impl Bibiman { let saved_key = citekey.to_owned(); // TODO: Only for testing purposes, needs better logic to find correct file // when using multi file approach - let filepath = args.pos_args[0].clone().into_os_string(); + let filepath = args.fileargs[0].as_os_str(); + let filepath = if args.fileargs.len() == 1 { + args.fileargs.first().unwrap().as_os_str() + }; let filecontent: &str = &self.main_biblio.bibfilestring; let mut line_count = 0; |
