aboutsummaryrefslogtreecommitdiff
path: root/src/cliargs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cliargs.rs')
-rw-r--r--src/cliargs.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cliargs.rs b/src/cliargs.rs
index 895f116..bb3c8d1 100644
--- a/src/cliargs.rs
+++ b/src/cliargs.rs
@@ -23,6 +23,7 @@ use std::env;
use std::path::PathBuf;
use walkdir::WalkDir;
+use crate::app;
use crate::tui::colors::AppColors;
// struct for CLIArgs
@@ -76,6 +77,12 @@ pub fn parse_files(args: Vec<PathBuf>) -> Vec<PathBuf> {
let mut files: Vec<PathBuf> = Vec::new();
// If pos arg is file, just push it to path vec
for i in args {
+ // Expand tilde to /home/user
+ let i = if i.starts_with("~") {
+ app::expand_home(&i)
+ } else {
+ i
+ };
if i.is_file() {
files.push(i);
// If pos arg is dir, walk dir and collect bibfiles