Skip to main content
-1 votes
0 answers
50 views

I have a tool that uses Click to define its CLI interface. It uses groups to achieve a subcommand hierarchy. So, if it is mytool, we have commands like mytool edit, mytool show, mytool execute script1....
Noob Doob's user avatar
  • 1,965
0 votes
1 answer
31 views

Here is short sample, which uses click==8.1.7 # main.py import click @click.command @click.option( "--disable-all", is_flag=True, default=False, deprecated="Please use --...
Hai Vu's user avatar
  • 41.4k
0 votes
0 answers
96 views

i am currently trying to get a compiled python project which is using click 8.0.4 running with shell_completion. My project contains multiple downstream scripts, which should support the ...
bigMre's user avatar
  • 39
2 votes
1 answer
151 views

I have this code in a CLI: @click.option( "--username", default=lambda: os.environ.get("USER", None), show_default=True, help="User name for SSH configuration.&...
codeforester's user avatar
  • 43.8k
0 votes
0 answers
80 views

I have the following ~minimal code: from typing import Annotated import typer def main( username: Annotated[ str, typer.Option("--username", "-u", help="...
Dror's user avatar
  • 13.2k
0 votes
0 answers
33 views

I am new to the click CLI library, so this might be something trivial. I have a script which has one group and one subcommand, something like this. It is a ML application which has a training phase ...
ayandas's user avatar
  • 2,318
1 vote
1 answer
69 views

I have a script which use click.group to provide sub commands. Each of the sub command might pass or fail. How do I propagate the exit code from the sub commands back to main? import click import sys ...
Hai Vu's user avatar
  • 41.4k
4 votes
1 answer
48 views

I have a simple Click app like this: import click @click.command() @click.argument('message') def main(message: str): click.echo(message) if __name__ == '__main__': main() When you pass an ...
Ram Rachum's user avatar
  • 89.5k
1 vote
1 answer
120 views

When click.secho("helo", fg="yellow") writes to a pipe, the colors are stripped by default. If there a way to force click to emit the color codes even when stdout is a pipe? ...
zapta's user avatar
  • 125
0 votes
0 answers
68 views

Some programs emit colored text when their output is connected to a terminal, and non colored text when their output goes to a pipe. Is there a way in Python to open a pipe to a subprocess such that ...
zapta's user avatar
  • 125
0 votes
2 answers
182 views

I am using python click options that are shared by multiple commands, as described at https://stackoverflow.com/a/77732441. Is there a simple way to customize the help= text of the list option in the ...
zapta's user avatar
  • 125
2 votes
1 answer
232 views

I have a Python program and am using Click to process the command line. I have a single command program, as in the example below. On Windows I would like to pass in a valid glob expression like *.py ...
Brad Campbell's user avatar
1 vote
1 answer
154 views

In Click, Context.with_resource's documentation states it can be used to: [r]egister a resource as if it were used in a with statement. The resource will be cleaned up when the context is popped. ...
Adam's user avatar
  • 506
2 votes
1 answer
121 views

Sample code: import click @click.command @click.option('-f/-F', 'var', default=True) def main(var): click.echo(var) main() Inside main() function, how can I check if var parameter got True value ...
Kossak's user avatar
  • 1,458
2 votes
1 answer
383 views

I want Typer to display my commands in the order I have initialized them and it displays those commands in alphabetic order. I have tried different approaches including this one: https://github.com/...
Swantewit's user avatar
  • 1,086

15 30 50 per page
1
2 3 4 5
38