chore: change up argument checking logic

This commit is contained in:
Harsh Shandilya 2022-02-16 18:40:19 +05:30
parent e0cbb15977
commit f1e2106152
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -18,14 +18,13 @@ fn main() -> Result<()> {
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_args() {
return Ok(());
if !check_for_version_arg() {
loop_clipboard(config);
}
loop_clipboard(config);
return Ok(());
}
fn check_args() -> bool {
fn check_for_version_arg() -> bool {
let args: Vec<String> = std::env::args().collect();
let version_args = vec!["version", "-v", "--version"];
for arg in args {