Remove flag

This commit is contained in:
Thomas Zahner 2025-05-09 12:20:32 +02:00
parent 3a0922757e
commit 4e16d2fc29
4 changed files with 1 additions and 35 deletions

View file

@ -445,9 +445,6 @@ Options:
--exclude-loopback
Exclude loopback IP address range and localhost from checking
--exclude-mail
Exclude all mail addresses from checking (deprecated; excluded by default)
--include-mail
Also check email addresses

View file

@ -34,25 +34,6 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc<CookieStoreMutex>>) -
.map(|value| StatusCode::from_u16(*value))
.collect::<Result<HashSet<_>, _>>()?;
// `exclude_mail` will be removed in 1.0. Until then, we need to support it.
// Therefore, we need to check if both `include_mail` and `exclude_mail` are set to `true`
// and return an error if that's the case.
if cfg.include_mail && cfg.exclude_mail {
return Err(anyhow::anyhow!(
"Cannot set both `include-mail` and `exclude-mail` to true"
));
}
// By default, clap sets `exclude_mail` to `false`.
// Therefore, we need to check if `exclude_mail` is explicitly set to
// `true`. If so, we need to set `include_mail` to `false`.
// Otherwise, we use the value of `include_mail`.
let include_mail = if cfg.exclude_mail {
false
} else {
cfg.include_mail
};
ClientBuilder::builder()
.remaps(remaps)
.base(cfg.base_url.clone())
@ -62,7 +43,7 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc<CookieStoreMutex>>) -
.exclude_private_ips(cfg.exclude_private)
.exclude_link_local_ips(cfg.exclude_link_local)
.exclude_loopback_ips(cfg.exclude_loopback)
.include_mail(include_mail)
.include_mail(cfg.include_mail)
.max_redirects(cfg.max_redirects)
.user_agent(cfg.user_agent.clone())
.allow_insecure(cfg.insecure)

View file

@ -172,11 +172,6 @@ fn load_config() -> Result<LycheeOptions> {
warn!("WARNING: `--exclude-file` is deprecated and will soon be removed; use the `{LYCHEE_IGNORE_FILE}` file to ignore URL patterns instead. To exclude paths of files and directories, use `--exclude-path`.");
}
// TODO: Remove this warning and the parameter with 1.0
if opts.config.exclude_mail {
warn!("WARNING: `--exclude-mail` is deprecated and will soon be removed; E-Mail is no longer checked by default. Use `--include-mail` to enable E-Mail checking.");
}
// TODO: Remove this warning and the parameter with 1.0
if opts.config.base.is_some() {
warn!(

View file

@ -427,12 +427,6 @@ and 501."
#[serde(default)]
pub(crate) exclude_loopback: bool,
/// Exclude all mail addresses from checking
/// (deprecated; excluded by default)
#[arg(long)]
#[serde(default)]
pub(crate) exclude_mail: bool,
/// Also check email addresses
#[arg(long)]
#[serde(default)]
@ -621,7 +615,6 @@ impl Config {
exclude_private: false;
exclude_link_local: false;
exclude_loopback: false;
exclude_mail: false;
format: StatsFormat::default();
remap: Vec::<String>::new();
fallback_extensions: Vec::<String>::new();