diff options
author | Joel Eager <git@joeleager.me> | 2019-07-12 21:08:08 -0500 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-03-03 23:03:06 -0800 |
commit | 2ba2fe0cf80a76e09a6e44c3750034574acd33d0 (patch) | |
tree | 01a6c377902ae58f3e891c0e16367a9630cb2d64 /src/click/termui.py | |
parent | af584b212c25f8479dcedf116f5895ee92c71f2c (diff) | |
download | click-2ba2fe0cf80a76e09a6e44c3750034574acd33d0.tar.gz |
progress bar shows current item
Co-authored-by: David Lord <davidism@gmail.com>
Diffstat (limited to 'src/click/termui.py')
-rw-r--r-- | src/click/termui.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/click/termui.py b/src/click/termui.py index 4fc7229..4ea76d8 100644 --- a/src/click/termui.py +++ b/src/click/termui.py @@ -366,10 +366,10 @@ def progressbar( `False` if not. :param show_pos: enables or disables the absolute position display. The default is `False`. - :param item_show_func: a function called with the current item which - can return a string to show the current item - next to the progress bar. Note that the current - item can be `None`! + :param item_show_func: A function called with the current item which + can return a string to show next to the progress bar. If the + function returns ``None`` nothing is shown. The current item can + be ``None``, such as when entering and exiting the bar. :param fill_char: the character to use to show the filled part of the progress bar. :param empty_char: the character to use to show the non-filled part of @@ -394,6 +394,9 @@ def progressbar( Output is shown even if execution time is less than 0.5 seconds. .. versionchanged:: 8.0 + ``item_show_func`` shows the current item, not the previous one. + + .. versionchanged:: 8.0 Labels are echoed if the output is not a TTY. Reverts a change in 7.0 that removed all output. |