lychee
lychee copied to clipboard
`--offline` flag is misleading
--offline Only check local files and block network requests
--offline
is misleading. I think a better name would be--include-local
or maybe even remove it altogether and only check if--base
is provided. - Quoting @mre
As a new user, I tried to use lychee
for checking links from local files only. No external requests was expected, I tried to troubleshoot why they were being made and thought --offline
would apply to my inputs (which were local files with incorrect path, that lychee
tried to request externally).
I was mistaken and --skip-missing
(hide and avoid exiting due to network failures technically, but works for local files that don't exist too) was the more appropriate option as it applied to inputs, whereas --offline
does not (only links parsed from inputs to check).
I am not sure, but --scheme 'file'
may provide equivalent functionality that --offline
does? (skipping other URIs rather than blocking?)
Using --scheme 'file'
against the example HTML content from this issue, src="assets/img/bg-water.webp"
was checked against the local file, while querying the local webserver version at localhost/index.html
the resource was skipped. So it seems to match --offline
, if a little less obvious.
The opposite behaviour (to check only network requests and ignore local file links) could be --scheme http https
, although that will exclude other URIs like data:
too.
I remember now that we wanted to deprecate --offline
in favor of https://github.com/lycheeverse/lychee/issues/452#issuecomment-1026277830.
This needs to happen before we hit 1.0.