mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-15 00:47:01 +05:30
chore: change up argument checking logic
This commit is contained in:
parent
e0cbb15977
commit
f1e2106152
1 changed files with 3 additions and 4 deletions
|
@ -18,14 +18,13 @@ fn main() -> Result<()> {
|
||||||
let config_path = get_config_path()?;
|
let config_path = get_config_path()?;
|
||||||
let config_str = std::fs::read_to_string(config_path.as_path()).unwrap_or_default();
|
let config_str = std::fs::read_to_string(config_path.as_path()).unwrap_or_default();
|
||||||
let config: Replacements<'_> = toml::from_str(&config_str)?;
|
let config: Replacements<'_> = toml::from_str(&config_str)?;
|
||||||
if check_args() {
|
if !check_for_version_arg() {
|
||||||
return Ok(());
|
loop_clipboard(config);
|
||||||
}
|
}
|
||||||
loop_clipboard(config);
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_args() -> bool {
|
fn check_for_version_arg() -> bool {
|
||||||
let args: Vec<String> = std::env::args().collect();
|
let args: Vec<String> = std::env::args().collect();
|
||||||
let version_args = vec!["version", "-v", "--version"];
|
let version_args = vec!["version", "-v", "--version"];
|
||||||
for arg in args {
|
for arg in args {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue