diff options
author | Julen Ruiz Aizpuru <julenx@gmail.com> | 2014-05-28 15:31:16 +0200 |
---|---|---|
committer | Julen Ruiz Aizpuru <julenx@gmail.com> | 2014-05-28 15:31:30 +0200 |
commit | bf94cbb1f4040908858ff54337d9721f720c2cfa (patch) | |
tree | 2744cbc2f679d0c2320fb777a048bac0c6059cda /docs/upgrading.rst | |
parent | c7299c431933db47c9fab6771e34a9dd46a09415 (diff) | |
download | click-bf94cbb1f4040908858ff54337d9721f720c2cfa.tar.gz |
Docs: fixes
Diffstat (limited to 'docs/upgrading.rst')
-rw-r--r-- | docs/upgrading.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/upgrading.rst b/docs/upgrading.rst index ac72ecd..6629845 100644 --- a/docs/upgrading.rst +++ b/docs/upgrading.rst @@ -13,13 +13,13 @@ Upgrading to 2.0 Click 2.0 has one breaking change which is the signature for parameter callbacks. Before 2.0 the callback was invoked with ``(ctx, value)`` -wheras now it's ``(ctx, param, value)``. This change was necessary as it +whereas now it's ``(ctx, param, value)``. This change was necessary as it otherwise made reusing callbacks too complicated. -To ease the transition Click will still accept old callbacks but it will +To ease the transition click will still accept old callbacks but it will issue a warning to stderr to encourage you to upgrade. -In case you want to support both Click 1.0 and Click 2.0 you can make a +In case you want to support both click 1.0 and click 2.0 you can make a simple decorator that adjusts the signatures:: import click @@ -38,6 +38,6 @@ With that helper you can then write something like this:: def callback(ctx, param, value): return value.upper() -Note that because Click 1.0 did not pass a parameter the `param` argument +Note that because click 1.0 did not pass a parameter the `param` argument here would be `None` so a compatibility callback could not use that argument. |