google / google/python-fire

feature request: allow passing unparsed parameters

未關閉
#118 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
28.2k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

a common idiom in cli is to have a flag (usually --, but this is taken here) that all text afterwards is passed as is (mostly for passing to other commands)

it could be useful to have a similar feature in fire

for example:

> example.py foo --- this is passed as is - --

example.py:
```
import fire

def hello(name, __unparsed__):
print(name)
print(__unparsed__)

if __name__ == '__main__':
fire.Fire(hello)

```
will yield:
> foo
> this is passed as is - --

貢獻指南

開啟貢獻指南

研究方向

從 Python Fire 的命令列解析入口開始,將要求的 `---` 範例與目前的引數處理進行比較。確定應如何表示未解析的文字,並透過一個有針對性的 CLI 測試驗證行為;當範例將剩餘文字原樣傳遞給 `__unparsed__` 且不破壞現有解析時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。