Make inputs required (show help if not provided) (#329)

This commit is contained in:
Matthias 2021-09-16 16:40:38 +02:00 committed by GitHub
parent dd667a656c
commit 712bdfa8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -140,7 +140,7 @@ outdated information.
Run it inside a repository with a `README.md`:
```sh
lychee
lychee README.md
```
You can also specify various types of inputs:
@ -190,7 +190,7 @@ see below for a full list.
```ignore
USAGE:
lychee [FLAGS] [OPTIONS] [--] [inputs]...
lychee [FLAGS] [OPTIONS] <inputs>...
FLAGS:
--dump Don't perform any link checking. Instead, dump all the links extracted from inputs that
@ -238,8 +238,7 @@ OPTIONS:
ARGS:
<inputs>... The inputs (where to get links to check from). These can be: files (e.g. `README.md`), file globs
(e.g. `"~/git/*/README.md"`), remote URLs (e.g. `https://example.org/README.md`) or standard
input (`-`). Prefix with `--` to separate inputs from options that allow multiple arguments
[default: README.md]
input (`-`). NOTE: Use `--` to separate inputs from options that allow multiple arguments
```
### Exit codes

View file

@ -88,8 +88,8 @@ pub(crate) struct LycheeOptions {
/// The inputs (where to get links to check from).
/// These can be: files (e.g. `README.md`), file globs (e.g. `"~/git/*/README.md"`),
/// remote URLs (e.g. `https://example.org/README.md`) or standard input (`-`).
/// Prefix with `--` to separate inputs from options that allow multiple arguments.
#[structopt(name = "inputs", default_value = "README.md")]
/// NOTE: Use `--` to separate inputs from options that allow multiple arguments.
#[structopt(name = "inputs", required = true)]
raw_inputs: Vec<String>,
/// Configuration file to use