google / google/python-fire

Support Bash Arrays

Đang mở
#182 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
28.2k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi there,
I love fire but I keep running in the same issue.

A lot of my scripts support a target directive so I can handover a list and it will iterate over the list.

If I combine that with Fire I need to write ugly python lists and can not use bash magic.
E.g. I need to write `python example.py count_lines '["file00", "file01", "file02"...]'` instead of something like 'python example.py count_lines "file{00..10}"` and I can not use any tab completion.

My current workaround is adding:
```
def count_lines(files):
if isinstance(files, str):
files = files.split()
...
```
One idea was to add this line with a special param like `--use-bash-arrays` to the Fire parser so I can run the script like: `python example.py count_lines "ffiles{00..}" -- --use-bash-arrays`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.