You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this great project!
Perhaps it's just me who feels that it is rather cumbersome mark a single parameter as deprecated (the closet I found was https://stackoverflow.com/a/50402799). Is there perhaps a more official method to mark a single parameter as deprecated?
That would somewhat be similar to #1507.
Possible scenarios:
the parameter was renamed (e.g. a previous version was using --name as option, but now a dev want's to make sure it's the --sur-name.
the parameter is not needed anymore
Perhaps as an example consider:
import click
@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name',
help='The person to greet.')
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):
click.echo(f"Hello {name}!")
if __name__ == '__main__':
hello()
and I want to rename --count to --greetings-count.
However I don't want to remove --count instantly, instead when users use --count prompt a message that they should use the new --greetings-count. The usage of --count and --greetings-count should be forbidden.
Thanks.
The text was updated successfully, but these errors were encountered:
You've linked that PR which has to fix the issue, but it's not clear how exactly - I mean the PR is rather about printing the thing out in help, right?
Is the more appropriate PR maybe already merged? Or it's not created yet?
edited:
Or rather that PR is only for covering deprecated attrs when used in custom Option classes like it is in linked example from SO?
Thanks for this great project!
Perhaps it's just me who feels that it is rather cumbersome mark a single parameter as deprecated (the closet I found was https://stackoverflow.com/a/50402799). Is there perhaps a more official method to mark a single parameter as deprecated?
That would somewhat be similar to #1507.
Possible scenarios:
--name
as option, but now a dev want's to make sure it's the--sur-name
.Perhaps as an example consider:
and I want to rename
--count
to--greetings-count
.However I don't want to remove
--count
instantly, instead when users use--count
prompt a message that they should use the new--greetings-count
. The usage of--count
and--greetings-count
should be forbidden.Thanks.
The text was updated successfully, but these errors were encountered: