Giter Site home page Giter Site logo

cli's People

Contributors

mailund avatar

Watchers

 avatar  avatar

cli's Issues

Document argument tags

I'm not sure where in the source I can add documentation for the tags, but it has to go somewhere.

Choices from maps

Ideally, we should get the options in a choice from the keys of a map, but then I need to handle all kinds of maps or use reflection, which gives the user an ugly interface. I'll wait for generics before I do that. A generic map[string]T will make it easy, and generics shouldn't be far away now...

Posix/gnu flags

Go's flags start with a single dash but almost everyone else use double dashes for flags with more than one character in the name. Check if there is a replacement package I can use instead of flag.

Choice-parameters (and maybe flags)

When a parameter must be one of a set of options, the user shouldn't have to use a string parameter and then check the result him/herself. It is simple to create a set of options, so that should be part of params.ParamSet. I can't insert the same in flag module, but with a callback function it should be easy to add the functionality.


Add file types to specs

If an argument is a reader or writer, the parser can open the files automatically. For flags, the default can easily be set to stdin/out/err

Simplify and refactor paramset

I don't need the non-Var functions with the new commands, so I can cut the interface in half.

With the callback interface, I really only need two functions, one for installing a positional argument and one for a variadic. They should then call a callback.

The different types of variables leads to some duplicated code, but maybe I can generate that code automatically.

Value interface for fields.

Flags have a Value interface that can work as a callback interface. If I can check if the field implements that, then I can do the same. It might be a simpler interface for extending the module.

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.