Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--offline flag is misleading #668

Open
polarathene opened this issue Jun 30, 2022 · 2 comments
Open

--offline flag is misleading #668

polarathene opened this issue Jun 30, 2022 · 2 comments
Assignees
Milestone

Comments

@polarathene
Copy link
Contributor

polarathene commented Jun 30, 2022

--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.

@mre
Copy link
Member

mre commented Jul 1, 2022

I remember now that we wanted to deprecate --offline in favor of #452 (comment).
This needs to happen before we hit 1.0.

@mre mre added this to the v1.0 milestone Jul 1, 2022
@mre mre added the deprecation label Jul 1, 2022
@mre mre self-assigned this Jan 6, 2025
@mre
Copy link
Member

mre commented Jan 6, 2025

In #1576, @trask implemented --root-dir, which was the missing piece to deprecate/remove --offline support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants