Git Product home page Git Product logo

Comments (5)

mre avatar mre commented on August 11, 2024 2

Sounds reasonable. #119 😄

from lychee.

mre avatar mre commented on August 11, 2024

We don't do anything fancy with --exclude; it's just a normal structopt field:

/// Exclude URLs from checking (supports regex)
#[structopt(long)]
#[serde(default)]
pub exclude: Vec<String>,

So I'd say that's kind of the convention in structopt when you have a field that uses Vec<_> as a type.
At least according to the POSIX standard it seems to be standard behavior:

See Guideline 10 here:

The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.

I agree that it can be counterintuitive. We can debate if we want to change it if there is a way so that structopt only takes a single argument after --exclude. I doubt that this is possible, though and there might be good reasons for it. 😉

from lychee.

MichaIng avatar MichaIng commented on August 11, 2024

Yes as said, it's not a bug, just a syntax that is probably rarely enough used so that inexperienced users and as well higher experienced developers like me sometimes run into 😅.

Mostly I know this from X server calls and similar, where you want to pass multiple parameters to the client/child layer, followed by parameters to the server/parent layer, which then need to be delimited by --, but indeed for multiple arguments to single options, when it's not such a multi-layer thing, at least me can't remember another case, currently.

Probably it's enough to add a line about this to readme + help output, which could be even written a way that makes clear that it is expected common syntax, so everyone who reads it get's used to it 😄:

Multiple arguments are allowed for this option, remember to use "--" to separate the list of exclusions from the list of inputs.

from lychee.

mre avatar mre commented on August 11, 2024

We have the same behavior for includes and headers. Would you add that note to all of these parameters in that case, add it to the lychee help output as a general note below all options, or just to the README.md?

from lychee.

MichaIng avatar MichaIng commented on August 11, 2024

Oh, I didn't think about that. To be effective, it would make sense in the usage/--help output of the binary itself, but not in full length below each option that supports multiple arguments.

Btw, I see now that it's already part of the usage info:

lychee [FLAGS] [OPTIONS] [--] [inputs]...

Maybe it's really just me who run into this, even overseeing this usage reminder. If at all, probably an additional sentence for the ARGS: <inputs>... block would do, like:

Prefix with "--" to separate inputs from options that allow multiple arguments.

from lychee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.