Coder Social home page Coder Social logo

Comments (7)

yoiang avatar yoiang commented on May 12, 2024

Hey @75lb ! I've spun up on using command-line-args and it's great! I was looking around for a required flag mechanism and noticed the closed issue, is it something that you feel isn't necessary?

from command-line-args.

75lb avatar 75lb commented on May 12, 2024

hi @yoiang, yes it was decided to keep input validation out of the library.. it's an opinionated area and best left down-stream..

you can check the output of cli.parse() and if your required value is missing, throw an exception.

from command-line-args.

75lb avatar 75lb commented on May 12, 2024

glad you like the library, don't be shy to make further suggestions - all good..

from command-line-args.

yoiang avatar yoiang commented on May 12, 2024

Gotcha, thanks :)

from command-line-args.

xescugc avatar xescugc commented on May 12, 2024

So the only way right now is to check the cli.parse()? I think the required flag is a really good idea because you can see the full description of the ARGV in the same part of the code, at the definition.

from command-line-args.

75lb avatar 75lb commented on May 12, 2024

@xescugc as i said before, required logic is opinionated and varies per option type.. what is required exactly? A value? Two values? Two values of length 3?

The library had a required flag two years ago when it was born, but it was quickly removed to give the user full control over validation logic (what is and is not valid).

from command-line-args.

xescugc avatar xescugc commented on May 12, 2024

For me the required flag means that the options with this flag are required to the export to execute, maybe another name is present but the name i don't care 😄 it's just the idea behind it. It's not a type/format validation, it s a presence validation. Does it make sense for you?

from command-line-args.

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.