diff options
Diffstat (limited to 'src/cliargs.rs')
| -rw-r--r-- | src/cliargs.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/cliargs.rs b/src/cliargs.rs index d4fac46..04886d1 100644 --- a/src/cliargs.rs +++ b/src/cliargs.rs @@ -33,6 +33,7 @@ pub struct CLIArgs { pub pos_args: Vec<PathBuf>, pub cfg_path: Option<PathBuf>, pub light_theme: bool, + pub pdf_path: Option<PathBuf>, } impl CLIArgs { @@ -55,6 +56,9 @@ impl CLIArgs { Short('v') | Long("version") => args.versionarg = true, Short('c') | Long("config-file") => args.cfg_path = Some(parser.value()?.parse()?), Long("light-terminal") => args.light_theme = true, + Long("pdf-dir") => { + args.pdf_path = Some(parser.value()?.parse()?); + } // Value(pos_arg) => parse_files(&mut args, pos_arg), Value(pos_arg) => args.pos_args.push(pos_arg.into()), _ => return Err(arg.unexpected()), @@ -122,11 +126,16 @@ POSITIONAL ARGS: Both can be passed multiple times FLAGS: - -h, --help Show this help and exit - -v, --version Show the version and exit - -c, --config-file Path to config file used for current session. - Takes precedence over standard config file. - --light-terminal Enable color mode for light terminal background", + -h, --help Show this help and exit + -v, --version Show the version and exit + -c, --config-file=<value> Path to config file used for current session. + Takes precedence over standard config file. + --light-terminal Enable color mode for light terminal background + --pdf-dir=<value> Use PDF files named by citekey at the given path and its + subdirs as value for the `file` field of the entry matching + the citekey for the current session. + Does not overwrite or change the original file. + (might not work with citekeys containing special chars)", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"), ); |
