click icon indicating copy to clipboard operation
click copied to clipboard

Hide default value when show_default is False

Open pfhayes opened this issue 2 years ago • 2 comments

Previously, when show_default was False on an Option, the value could still appear in the prompt. Remove this so that sensitive values can be hidden from prompts.

Checklist:

  • [x] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • [x] Add or update relevant docs, in the docs folder and in code.
  • [x] Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • [x] Add .. versionchanged:: entries in any relevant code docs.
  • [x] Run pre-commit hooks and fix any issues.
  • [x] Run pytest and tox, no tests failed.

pfhayes avatar May 05 '23 18:05 pfhayes

Also, this PR doesn't pass pre-commit at the moment. You might want to run pre-commit run -a in order to make sure that all files are according to Click's style guideline.

saroad2 avatar May 08 '23 04:05 saroad2

Issues fixed. Added comment and also restructured code to make behavior of show_default arg to prompt more explicit

pfhayes avatar May 08 '23 16:05 pfhayes