Coder Social home page Coder Social logo

Comments (4)

BrianPugh avatar BrianPugh commented on May 16, 2024 1

Ah yes, I forgot about usage.

I'll do this two-fold:

  1. Improve the current usage to be more consistent with other libraries (the current was a bit of a lazy place holder).

  2. Allow manual override via a supplied string usage="My Usage".

  3. Allow disabling it via supplying an empty string.

from cyclopts.

Skyler-Altol avatar Skyler-Altol commented on May 16, 2024 1

@BrianPugh would it not be more consistent with the general patterns of python (and this project) to use None for the disabling component? Just a thought :)

Also, great work with this project, I was a heavy user of Typer before I came across this in one of the issues as a resolution to an issue that Typer has refused to fix for years. I'll be raising some ideas in here myself soon ❤️

from cyclopts.

BrianPugh avatar BrianPugh commented on May 16, 2024

In Cyclopts, None always resolves to "default behavior", which is also a common python pattern. Typically, the default behavior is to "derive data from some source." Frequently, the defaults can be overridden with a user-provided string, so an Optional[str] type makes sense. Finally, what if the user want's to disable a feature? A natural extension of this is the manual override of an empty string.

When a user-provided str value doesn't make sense (e.g. show_env_var), a bool is a natural choice.

from cyclopts.

BrianPugh avatar BrianPugh commented on May 16, 2024

closing with the release of v2. We can reopen this issue, or open a new one, should the need arise.

I'll work on improving the default usage string to be at parity with other tools like argparse/click/typer in the near future.

from cyclopts.

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.