Giter VIP home page Giter VIP logo

Comments (2)

nderjung avatar nderjung commented on July 21, 2024 1

The output should look similar to this, yes. :D

You can use pflag.SetAnnotation against a flag to attribute it to a group:

https://github.com/spf13/pflag/blob/85dd5c8bc61cfa382fecd072378089d4e856579d/flag.go#L497-L511

to annotate a flag against a group alias name. E.g. the annotation group:global would be the annotation and the "key" would be "global". When the help command is invoked, the key could be looked up against an index of group names, where "global" would correspond to the string "Global flags".

Not sure where group names should be saved though. Perhaps it should be possible via the cmdutil library to register a new group, e.g. a publicaly exposed API cmdutil.RegisterNewFlagGroup(key, title string) which saves to a local variable map which is then referenced (in the same vein as cmdutil.RegisterFlag).

from kraftkit.

gabrielmocanu avatar gabrielmocanu commented on July 21, 2024

For this one, we should have something similar with this?

from kraftkit.

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.