Giter Club home page Giter Club logo

Comments (1)

florimondmanca avatar florimondmanca commented on August 20, 2024 1

@valpesendorfer Hello!

The usage is rendered directly from Click, and in particular for the command name we use Click's command.name. As you can see below it transforms underscores into hyphens:

import click

@click.command()
def cli_test():
    pass

print(cli_test.name)  # "cli-test"

As an alternative, we could consider using command.callback.__name__. But then explicit name set on commands wouldn't be honored, and that would be a proper bug. Our best bet to stick to Click's behavior as closely as we can.

So if you'd like the Usage: ... to show cli_test [OPTIONS] ..., then you might want to consider doing:

@click.command(name="cli_test")
def cli_test():
    pass

I'd agree that looks kind of funky, but that's just how Click treats command names… You could consider digging into issues on the click repo to see if there's anyone who suggested changing that behavior.

For now, since we have a workaround and it doesn't seem to really be on us, I'll close this for now. Thanks. :-)

from mkdocs-click.

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.