Coder Social home page Coder Social logo

Improve cli about woodpecker HOT 5 OPEN

anbraten avatar anbraten commented on August 17, 2024
Improve cli

from woodpecker.

Comments (5)

xoxys avatar xoxys commented on August 17, 2024

@woodpecker-ci/maintainers I would like to work on improve error handling for missing args (missing repo id / name results in an parseInt error atm) How do we want to handle it? Do we really want to continue using args? IMO, it would be better to drop args completely and just use flags. Any reason to keep using args?

from woodpecker.

anbraten avatar anbraten commented on August 17, 2024

I think its quite common practice to use args (see kubectl, docker, ...) therefore I would suggest to stick to it and add an empty-string check with a more descriptive error in front of the parseInt call.

from woodpecker.

xoxys avatar xoxys commented on August 17, 2024

Obviously, but I could also name a lot of tools without args. We could have a way more clean code without arg validation, as flag validation and required flags is a built-in feature of urfave/cli. However, if args is preferred, that works for me as well.

from woodpecker.

lafriks avatar lafriks commented on August 17, 2024

I don't know if urfave/cli still checks that required arguments are not empty if required (you can provide argument but provide it with empty value) so check for empty value could still be needed

from woodpecker.

xoxys avatar xoxys commented on August 17, 2024

There is no required args feature, just a required flags option.

from woodpecker.

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.