Is there a way to only show base "--help" for explicitly defined options?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia da traitlets.config.application.Application e traccia come viene assemblato l'output di --help a partire dagli alias e dalle opzioni integrate. Verifica il comportamento desiderato usando l'esempio: --help dovrebbe mostrare solo le opzioni definite esplicitamente, come --github-token, mentre --help-all dovrebbe rimanere disponibile per l'insieme completo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!!
- Lingua principale
- Python
- Stelle
- 653
- Fork
- 217
- Merge medio
- 2g 21h
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ipython/traitlets
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di ipython/traitlets
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100