google / google/python-fire

Option to print help to std out

Đang mở
#188 41 bình luận 39 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ả

Thanks for creating Fire. It's a fantastic argument parsing tool.

A minor request: I prefer my help strings to be printed to stdout instead of a console like `less`. When the output is sent to a `less`-like program you can't reference the script argument information when trying to type your next command.

The naive way to allow this option is adding a switch so the user can choose to send information console package or to stdout (code below).

https://github.com/google/python-fire/blob/d77453938a4b7a5a2bb71d9cb40397ee8bbc2e0a/fire/core.py#L171
to something like
```
if print_std:
print(text, file=out)
else:
console_io.More(
```

I don't see an elegant way to set `print_std` in your source code since you are not accepting contributions to your console package and the `Display` function is not a method of the Fire class. I don't see a straightforward way to have the user set this display option. Obviously, you know the code better than me so you may know a good way to add this option.

I am using fire version 0.2.1 and have seen this behavior with Ubuntu 16.04 and 18.04.

Thank you for your time!

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.