Is there a way to only show base "--help" for explicitly defined options?
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par traitlets.config.application.Application et suivez la manière dont la sortie de --help est assemblée à partir des alias et des options intégrées. Vérifiez le comportement attendu à l’aide de l’exemple : --help ne doit afficher que les options définies explicitement, telles que --github-token, tandis que --help-all reste disponible pour l’ensemble complet.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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!!
- Langage dominant
- Python
- Étoiles
- 653
- Forks
- 221
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ipython/traitlets
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
-
Difficulté 1/5 1-3 heures Accessibilité débutants 65/100
-
Add Deprecation of Trait Declarations via Classes to Migration NotesPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertegood first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
-
Document `TraitType.read_only`Ouvertedocumentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
-
traitlets.Set should support generic type annotations for type safetyPeut-être pris @GruffElixir l’a pris il y a 34 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
Toutes les issues de ipython/traitlets
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
huggingface/peft#3955 ·
Les mainteneurs répondent en général sous 1 jour
-
author-page correction
Difficulté 2/5 1-3 heures Accessibilité débutants 60/100
acl-org/acl-anthology#10313 ·
Les mainteneurs répondent en général sous 1 jour
-
anime duplicate exception request-theme
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
LizardByte/ThemerrDB#8926 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
huggingface/transformers#49556 ·
Les mainteneurs répondent en général sous 1 jour
-
area/security bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
mozilla-ai/otari#2245 ·
Les mainteneurs répondent en général sous 1 jour