Skip to content

Implement --files-from Option#1836

Merged
mre merged 2 commits intomasterfrom
files-from
Sep 5, 2025
Merged

Implement --files-from Option#1836
mre merged 2 commits intomasterfrom
files-from

Conversation

@mre
Copy link
Member

@mre mre commented Sep 3, 2025

This allows providing a list of inputs from a file or stdin.

How it works

  1. Create a inputs.txt file with all the inputs (files) you'd like to check for broken links.
  2. Pass that to lychee with
    lychee --files-from inputs.txt

lychee will then use the files from inputs.txt as inputs. You can still provide custom inputs as well with

lychee --files-from inputs.txt another_input.md

The inputs file can contain comments, such as

# Ignore this line
some_input.txt
# Ignore this line as well

Closes: #662

This allows providing a list of inputs from a file or `stdin`.

## How it works

1. Create a `inputs.txt` file with all the inputs (files) you'd like to check for broken links.
2. Pass that to `lychee` with
   ```sh
   lychee --files-from inputs.txt
   ```

lychee will then use the files from `inputs.txt` as inputs. You can still provide custom inputs as well with

```sh
lychee --files-from inputs.txt another_input.md
```

The inputs file can contain comments, such as

```text
# Ignore this line
some_input.txt
# Ignore this line as well
```

Closes: #662
Copy link
Member

@thomas-zahner thomas-zahner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Co-authored-by: Thomas Zahner <thomas.zahner@protonmail.ch>
@mre mre merged commit d6b16bc into master Sep 5, 2025
6 checks passed
@mre mre deleted the files-from branch September 5, 2025 16:07
@mre mre mentioned this pull request Sep 5, 2025
This was referenced Oct 21, 2025
@thomas-zahner
Copy link
Member

@mre Shouldn't it now also be possible to now specify files_from in the config file? It doesn't seem to work.

@thomas-zahner
Copy link
Member

Never mind, investigated and solved in 07213f8. Will soon create a PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to provide a list of inputs from a file or stdin

2 participants