mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-14 22:27:03 +05:30
refactor: bail early if version is requested
This commit is contained in:
parent
ab883c356a
commit
86ea822d2c
1 changed files with 4 additions and 3 deletions
|
@ -16,13 +16,14 @@ use crate::config::{Act, Match, Replacements};
|
|||
const VERSION_ARGS: [&str; 3] = ["version", "-v", "--version"];
|
||||
|
||||
fn main() -> Result<()> {
|
||||
if check_for_version_arg() {
|
||||
return Ok(());
|
||||
}
|
||||
pretty_env_logger::init();
|
||||
let config_path = get_config_path()?;
|
||||
let config_str = std::fs::read_to_string(config_path.as_path()).unwrap_or_default();
|
||||
let config: Replacements<'_> = toml::from_str(&config_str)?;
|
||||
if !check_for_version_arg() {
|
||||
loop_clipboard(config);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue