Git Product home page Git Product logo

Comments (7)

kdeldycke avatar kdeldycke commented on June 4, 2024 1

BTW, I used your issue as an excuse to bootstrap the version option documentation at: https://kdeldycke.github.io/click-extra/version.html

from click-extra.

kdeldycke avatar kdeldycke commented on June 4, 2024 1

I just realized that this is something that was more or less requested by @puzzlepeaches in #319. The difference with the later is that the --config parameter is provided on the command line, so there is an alternative way to gather this raw, unprocessed value.

I guess this workaround was good enough in that case, but doesn't cut it for the --version parameter.

All in all, there is an opportunity somewhere to have all processed parameters be available in the context.

from click-extra.

kdeldycke avatar kdeldycke commented on June 4, 2024 1

Another thing to consider is the way I keep the table format ID in the context. See: 9121c6f

from click-extra.

kdeldycke avatar kdeldycke commented on June 4, 2024 1

Good news @rasa, you can now fetch version's metadata from the context. Everything's explained in the documentation: https://kdeldycke.github.io/click-extra/version.html#get-metadata-values

It is part of the main branch and will be available in the upcoming Click Extra v4.5.0 release.

from click-extra.

kdeldycke avatar kdeldycke commented on June 4, 2024 1

Click Extra 4.5.0 has just been released, and now expose all sorts of version-related metadata in the context: https://kdeldycke.github.io/click-extra/version.html#get-metadata-values

from click-extra.

kdeldycke avatar kdeldycke commented on June 4, 2024

As a reminder, the current version option in Click Extra is a full copy of Click's original code. But made into a class here, to allow its use with the declarative params= argument. Which fixes Click #2324 issue.

So in its current capacity the version string is not exposed. It is detected or consumed right before exit the CLI execution flow, as you can see here:

echo(output, color=ctx.color)
ctx.exit()

To have it support what you're looking for, we need to refactor the version code and enhance it. This is a feature request.

from click-extra.

github-actions avatar github-actions commented on June 4, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from click-extra.

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.