From d6a763a90b92790ba19ccb536c088a32e9fbb094 Mon Sep 17 00:00:00 2001 From: Fries Date: Mon, 3 Jul 2023 16:19:45 -0700 Subject: [PATCH] change spelling of seperator to separator looks like i spelt that wrong.. --- cli/src/arguments.rs | 4 ++-- cli/src/commands/add.rs | 4 ++-- cli/src/commands/print.rs | 14 +++++++------- cli/src/commands/remove.rs | 4 ++-- cli/src/commands/utils.rs | 4 ++-- cli/src/main.rs | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cli/src/arguments.rs b/cli/src/arguments.rs index 3c098b5..fd38f91 100644 --- a/cli/src/arguments.rs +++ b/cli/src/arguments.rs @@ -8,9 +8,9 @@ pub(crate) struct Arguments { #[arg( long, short, - help = "a seperator string to seperate the url from the name. defaults to : with a space after that." + help = "a separator string to seperate the url from the name. defaults to : with a space after that." )] - pub(crate) seperator: Option, + pub(crate) separator: Option, #[command(subcommand)] pub(crate) command: Commands, } diff --git a/cli/src/commands/add.rs b/cli/src/commands/add.rs index 042ef8d..13be1e4 100644 --- a/cli/src/commands/add.rs +++ b/cli/src/commands/add.rs @@ -10,7 +10,7 @@ pub(crate) fn add( path: &Path, url: &String, name: &Option, - seperator: &String, + separator: &String, ) -> Result<(), Error> { let names_file = names::read_names_file(path)?; let mut names = names::load_names(names_file)?; @@ -36,7 +36,7 @@ pub(crate) fn add( std::fs::write(path, json).unwrap(); println!( "added {} to names.json", - site_string(&site, PrintOptions::All, seperator) + site_string(&site, PrintOptions::All, separator) ); Ok(()) diff --git a/cli/src/commands/print.rs b/cli/src/commands/print.rs index 066dce4..ca60815 100644 --- a/cli/src/commands/print.rs +++ b/cli/src/commands/print.rs @@ -11,7 +11,7 @@ pub(crate) fn print( path: &Path, filter: &Option, group: &PrintGroup, - seperator: &String, + separator: &String, json: bool, ) -> Result<(), Error> { let names_file = names::read_names_file(path)?; @@ -25,7 +25,7 @@ pub(crate) fn print( data: "this url was not found in names.json".into(), }); } - return filter_site(&names[0], json, seperator, group); + return filter_site(&names[0], json, separator, group); } for site in names { @@ -34,7 +34,7 @@ pub(crate) fn print( continue; } - printing(seperator, &site, group); + printing(separator, &site, group); } Ok(()) @@ -43,7 +43,7 @@ pub(crate) fn print( fn filter_site( site: &Site, json: bool, - seperator: &String, + separator: &String, group: &PrintGroup, ) -> Result<(), Error> { if json { @@ -51,7 +51,7 @@ fn filter_site( return Ok(()); } - return Ok(printing(seperator, site, group)); + return Ok(printing(separator, site, group)); } fn json_printing(site: &Site) -> Result<(), Error> { @@ -67,8 +67,8 @@ fn json_printing(site: &Site) -> Result<(), Error> { } } -fn printing(seperator: &String, site: &Site, group: &PrintGroup) { - let string = site_string(site, print_group_to_options(group), seperator); +fn printing(separator: &String, site: &Site, group: &PrintGroup) { + let string = site_string(site, print_group_to_options(group), separator); println!("{}", string); } diff --git a/cli/src/commands/remove.rs b/cli/src/commands/remove.rs index 4e7906c..603d94f 100644 --- a/cli/src/commands/remove.rs +++ b/cli/src/commands/remove.rs @@ -3,7 +3,7 @@ use std::path::Path; use crate::commands::utils::{site_string, PrintOptions}; -pub(crate) fn remove(path: &Path, url: &String, seperator: &String) -> Result<(), Error> { +pub(crate) fn remove(path: &Path, url: &String, separator: &String) -> Result<(), Error> { let names_file = names::read_names_file(path)?; let mut names = names::load_names(names_file)?; @@ -11,7 +11,7 @@ pub(crate) fn remove(path: &Path, url: &String, seperator: &String) -> Result<() if &site.url == url { println!( "removing {} from names.json", - site_string(&site, PrintOptions::All, seperator) + site_string(&site, PrintOptions::All, separator) ); } &site.url != url diff --git a/cli/src/commands/utils.rs b/cli/src/commands/utils.rs index 426975b..61ab040 100644 --- a/cli/src/commands/utils.rs +++ b/cli/src/commands/utils.rs @@ -6,7 +6,7 @@ pub(super) enum PrintOptions { All, } -pub(super) fn site_string(site: &Site, options: PrintOptions, seperator: &String) -> String { +pub(super) fn site_string(site: &Site, options: PrintOptions, separator: &String) -> String { let mut string = String::new(); if matches!(options, PrintOptions::Url) || matches!(options, PrintOptions::All) { @@ -18,7 +18,7 @@ pub(super) fn site_string(site: &Site, options: PrintOptions, seperator: &String return string; } if !string.is_empty() { - string += &format!("{}{}", seperator, name) + string += &format!("{}{}", separator, name) } else { string += name; } diff --git a/cli/src/main.rs b/cli/src/main.rs index 2b070dd..39f429b 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -13,7 +13,7 @@ fn main() -> Result<(), Error> { let default_path = directories::get_names_path()?; let args = Arguments::parse(); - let seperator = args.seperator.unwrap_or(": ".into()); + let separator = args.separator.unwrap_or(": ".into()); let path = match &args.path { Some(path) => Path::new(path), @@ -25,9 +25,9 @@ fn main() -> Result<(), Error> { filter, group, json, - } => print(path, filter, group, &seperator, *json)?, - Commands::Add { url, name } => add(path, url, name, &seperator)?, - Commands::Remove { url } => remove(path, url, &seperator)?, + } => print(path, filter, group, &separator, *json)?, + Commands::Add { url, name } => add(path, url, name, &separator)?, + Commands::Remove { url } => remove(path, url, &separator)?, }; Ok(())