Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Case handling for `Choice` help output (values forced to lowercase)

未关闭
#588 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli

调研方向

使用 lean live deploy --help 重现回归,并比较 Click 8.1.8 与 8.2.0 或 8.2.1。首先检查 Click Choice 的行为以及 PR #2796 中的注册变更。当帮助输出保留已注册的大小写,同时不区分大小写的解析仍能正常工作时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
主要语言
Python
星标
326
派生
168
平均合并
3 天 50 分钟
30 天内合并 PR
3

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

QuantConnect/lean-cli 的其他 Issue

查看 QuantConnect/lean-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。