Expected Behavior
Values passed to click.Choice should preserve their original casing when displayed in --help output.
Example:
--brokerage [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|IQFeed|Polygon|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca|Tastytrade|Eze]
Actual Behavior
Since Click 8.2.0, all values are displayed in lowercase, regardless of how they were registered:
--brokerage [paper trading|interactive brokers|tradier|oanda|bitfinex|coinbase advanced trade|binance|zerodha|samco|terminal link|trading technologies|kraken|charlesschwab|bybit|tradestation|alpaca|tastytrade|eze]
This misleads users into thinking only lowercase values are accepted.
Potential Solution
- create custom class
MyChoice(Choice)
override get_metavar(...)
- Continue using case-folding for parsing input when case_sensitive=False.
- The regression likely comes from PR #2796, which lowercases values when registering.
Reproducing the Problem
-
run: lean live deploy --help
-
Click 8.1.8: casing preserved ✅
-
Click 8.2.0+: values all lowercase ❌
System Information
- Click version(s): 8.2.0, 8.2.1 (regression)
- Last working version: 8.1.8
- OS: All (confirmed on Windows 10, Ubuntu 22.04)
- Python: 3.11
Checklist
Expected Behavior
Values passed to click.Choice should preserve their original casing when displayed in --help output.
Example:
Actual Behavior
Since Click 8.2.0, all values are displayed in lowercase, regardless of how they were registered:
This misleads users into thinking only lowercase values are accepted.
Potential Solution
MyChoice(Choice)override get_metavar(...)Reproducing the Problem
run:
lean live deploy --helpClick 8.1.8: casing preserved ✅
Click 8.2.0+: values all lowercase ❌
System Information
Checklist
masterbranch