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

Add skip_missing flag, add Input enum (closes #26) #35

Merged
merged 12 commits into from
Dec 2, 2020
80 changes: 80 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ quick-xml = "0.20.0"
headers = "0.3.2"
derive_builder = "0.9.0"
deadpool = "0.6.0"
shellexpand = "2.0"
lazy_static = "1.1"

[dependencies.reqwest]
features = ["gzip"]
Expand All @@ -43,3 +45,5 @@ version = "0.2"
wiremock = "0.3"
assert_cmd = "1.0"
predicates = "1.0"
uuid = { version = "0.8", features = ["v4"] }
tempfile = "3.1"
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,32 @@ cargo install lychee

## Usage

Run it inside a repository with a `README.md`, or specify a file with
Run it inside a repository with a `README.md`:

```
lychee <yourfile>
lychee
```

You can also specify various types of inputs:

```
# check links on a website:
lychee https://endler.dev/

# check links in a remote file:
lychee https://raw.githubusercontent.com/lycheeverse/lychee/master/README.md

# check links in local file(s):
lychee README.md
lychee test.html info.txt

# check links in local files (by shell glob):
lychee ~/projects/*/README.md

# check links in local files (lychee supports advanced globbing and ~ expansion):
lychee "~/projects/big_project/**/README.*"
# ignore case when globbing, displaying progress and check result for each link:
lychee --glob-ignore-case --progress --verbose "~/projects/**/[r]eadme.*"
```

Optional (to avoid getting rate-limited): set an environment variable with your Github token
Expand All @@ -93,7 +115,7 @@ config file.
### CLI exit codes

- `0` for success (all links checked successfully or excluded/skipped as configured)
- `1` for any unexpected runtime failures or config errors
- `1` for missing inputs and any unexpected runtime failures or config errors
mre marked this conversation as resolved.
Show resolved Hide resolved
- `2` for link check failures (if any non-excluded link failed the check)

## Troubleshooting and workarounds
Expand Down
3 changes: 0 additions & 3 deletions fixtures/TEST_404.md

This file was deleted.

Loading