Is there a way to only show base "--help" for explicitly defined options?
まだ誰も着手していません。
評価
調査の方向性
traitlets.config.application.Application から始め、aliases と組み込みオプションから --help の出力がどのように組み立てられるかを追跡します。例を基に期待される動作を確認します。--help には --github-token のように明示的に定義されたオプションだけが表示され、完全なセットについては --help-all を引き続き利用できるようにします。
索引モデルが issue の本文から書いたものです。
説明
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!!
- 主要言語
- Python
- スター
- 653
- フォーク
- 217
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ipython/traitlets のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
ipython/traitlets の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100