Method needed to get rake command line options for spawning new rake job
Nessuno ha ancora preso questa issue.
- Lingua principale
- Ruby
- Stelle
- 2.5k
- Fork
- 650
- Merge medio
- 6m
- PR unite (30g)
- 3
Descrizione
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.
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.
Direzione di ricerca
Inizia da Rake.application e segui i punti di ingresso handle_options e standard_rake_options per vedere come vengono analizzate e mantenute le opzioni della riga di comando. Verifica come un Rakefile di primo livello potrebbe leggere il valore analizzato quando avvia job nelle sottodirectory. Il lavoro è completato quando le opzioni analizzate sono esposte tramite un attributo pubblico application senza richiedere ai chiamanti di duplicare l'analisi delle opzioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ruby
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100