Is there a way to only show base "--help" for explicitly defined options?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với traitlets.config.application.Application và theo dõi cách đầu ra của --help được tạo từ các alias và tùy chọn tích hợp sẵn. Xác nhận hành vi mong muốn dựa trên ví dụ: --help chỉ nên hiển thị các tùy chọn được định nghĩa rõ ràng, chẳng hạn như --github-token, trong khi --help-all vẫn có sẵn cho toàn bộ tập hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When creating the aliases, flags, etc for the options, is there a way to only show those options that I've explicitly defined?
For example, consider this code:
from traitlets import Unicode
from traitlets.config import SingletonConfigurable
from traitlets.config.application import Application
class ConfigStore(SingletonConfigurable):
github_token = Unicode("", help="Your Github access token").tag(config=True)
class AppController(Application):
classes = [ConfigStore]
aliases = {
("github-token"): (
"ConfigStore.github_token",
"your github access token, usually set via environment variable GITHUB_TOKEN",
),
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if __name__ == "__main__":
app = AppController()
app.launch_instance()
When called with --help it outputs the following:
This is an application.
Options
=======
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
<cmd> --help-all
--debug
Set log-level to debug, for the most verbose logging.
Equivalent to: [--Application.log_level=10]
--show-config
Show the application's configuration (human-readable format)
Equivalent to: [--Application.show_config=True]
--show-config-json
Show the application's configuration (json format)
Equivalent to: [--Application.show_config_json=True]
--github-token=<Unicode>
your github access token, usually set via environment variable GITHUB_TOKEN
Default: ''
Equivalent to: [--ConfigStore.github_token]
To see all available configurables, use `--help-all`.
Is there a way to configure the Application such that it only displays this:
--github-token=<Unicode>
your github access token, usually set via environment variable GITHUB_TOKEN
Default: ''
Sorry to ask a question in a github issue. Is there a better forum to ask these sorts of questions? Thank you!!
- Ngôn ngữ chính
- Python
- Star
- 653
- Fork
- 217
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ipython/traitlets
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Document `TraitType.read_only` Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của ipython/traitlets
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100