question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for `TyperArgument` arguments

See original GitHub issue

It seems like typer.Argument params are being grouped in with the other options. This happens whether or not SHOW_ARGUMENTS is enabled.

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
zmooncommented, Jul 7, 2022

How about this?

from rich_click import typer

typer.rich_click.SHOW_ARGUMENTS = True


def cli(
    name: str = typer.Argument("World"),
    say_hi: bool = typer.Option(True),
):
    if say_hi:
        print(f"Hello, {name}!")


if __name__ == "__main__":
    typer.run(cli)

The argument shows with SHOW_ARGUMENTS = True set, but in the Options section. Same result regardless of the setting of GROUP_ARGUMENTS_OPTIONS.

image

1reaction
taranlu-houzzcommented, Jul 11, 2022

@AlirezaTheH @ewels @zmoon Hey, sorry I never got back on this. Thanks for taking things forward!

Read more comments on GitHub >

github_iconTop Results From Across the Web

typing — Support for type hints — Python 3.11.1 documentation
In the function greeting , the argument name is expected to be of type str and the return type str . Subtypes are...
Read more >
Documentation - More on Functions - TypeScript
By adding a type parameter Type to this function and using it in two places, we've created a link between the input of...
Read more >
Typescript: type assist for function argument - Stack Overflow
I've written a little library and now I'm trying to add type support for it through creating custom d.ts files.
Read more >
CLI Arguments with Help - Typer - tiangolo
Argument () , let's use it to add documentation specific for a CLI argument. Add a help text for a CLI argument¶. You...
Read more >
Constraints on type parameters - C# Programming Guide
Learn about constraints on type parameters. Constraints tell the compiler what capabilities a type argument must have.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found