aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorlukeflo2024-10-08 22:48:53 +0200
committerlukeflo2024-10-12 22:41:38 +0200
commit2aaee4d89f7d8ee683a0d50f21723d908dec3e46 (patch)
tree973beeb3d1ff543971b7bca1aa22df361354cc25 /src/backend
parente425c7dcdf444de1151ab3f5347e6503cd0452b9 (diff)
downloadbibiman-2aaee4d89f7d8ee683a0d50f21723d908dec3e46.tar.gz
bibiman-2aaee4d89f7d8ee683a0d50f21723d908dec3e46.zip
open URLs, DOIs and PDFs
+ Implement opening mechanism for URLs, DOIs and PDFs + Adding logic to reset selected item after editing to same entry as before
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/bib.rs1
-rw-r--r--src/backend/cliargs.rs23
2 files changed, 1 insertions, 23 deletions
diff --git a/src/backend/bib.rs b/src/backend/bib.rs
index 3e0e844..bfc959d 100644
--- a/src/backend/bib.rs
+++ b/src/backend/bib.rs
@@ -17,7 +17,6 @@
use biblatex::{self, Bibliography};
use biblatex::{ChunksExt, Type};
-use color_eyre::eyre::ErrReport;
use std::{fs, path::PathBuf};
// Set necessary fields
diff --git a/src/backend/cliargs.rs b/src/backend/cliargs.rs
index 31d37f0..d3a4652 100644
--- a/src/backend/cliargs.rs
+++ b/src/backend/cliargs.rs
@@ -15,7 +15,6 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
/////
-use core::panic;
use std::path::PathBuf;
use sarge::prelude::*;
@@ -45,7 +44,7 @@ impl CLIArgs {
PathBuf::from(&pos_args[1])
// pos_args[1].to_string()
} else {
- panic!("No path to bibfile provided as argument")
+ PathBuf::new()
};
Self {
helparg: cli_args.help,
@@ -55,26 +54,6 @@ impl CLIArgs {
}
}
-// Struct for positional arguments
-// TODO: Can surely be improved!!
-// pub struct PosArgs {
-// pub bibfilearg: PathBuf,
-// }
-
-// impl PosArgs {
-// pub fn parse_pos_args() -> Self {
-// let (_, pos_args) = ArgumentsCLI::parse().expect("Could not parse positional arguments");
-// Self {
-// bibfilearg: if pos_args.len() > 1 {
-// PathBuf::from(&pos_args[1])
-// // pos_args[1].to_string()
-// } else {
-// panic!("No path to bibfile provided as argument")
-// }, // bibfilearg: pos_args[1].to_string(),
-// }
-// }
-// }
-
pub fn help_func() -> String {
let help = format!(
"\