Method needed to get rake command line options for spawning new rake job
Personne n'a encore pris cette issue.
- Langage dominant
- Ruby
- Étoiles
- 2.5k
- Forks
- 650
- Merge moyen
- 6 min
- PR mergées (30 j)
- 3
Description
I am implementing a "top level" Rakefile that will spawn off rake jobs in sub-directories.
This is not hard to do, except that I want to pass the same options to the jobs that was passed to the original rake command. I cannot find a way to reliably find out what those options were without using some quasi private methods such as handle_options in the application object. I do not want the targets, just the options.
Could we add code to handle_options to put the options that are parsed into an array that is a public attribute of the application object?
Then I could grab the rake options by a simple use of something like:
Rake.application.rake_options
If there is some way to easily do this that I am missing please let me know. I originally was just iterating over the ARGV entries and grabbing things out of it, but quickly realized that the command line options may or may not have an argument following a "-" prefixed option and there is no way I can know that without duplicating all the code in standard_rake_options.
Thanks.
Guide de contribution
Ouvrir 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.
Piste de recherche
Commencez par Rake.application et suivez les points d’entrée handle_options et standard_rake_options pour voir comment les options de ligne de commande sont analysées et conservées. Vérifiez comment un Rakefile de niveau supérieur pourrait lire la valeur analysée lors du lancement de tâches dans des sous-répertoires. Le travail est terminé lorsque les options analysées sont exposées via un attribut public application, sans obliger les appelants à dupliquer l’analyse des options.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- ruby
- Domaine
- cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100