Parsing --help needs to return something other than an error
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia tracciando come viene analizzato il testo di --help e come vengono esposti gli errori di analisi e i codici di ritorno. Esamina per confronto il comportamento descritto nell’issue di halp collegata e nelle pull request di busted. Il lavoro è completato quando richiedere esplicitamente --help produce il messaggio di aiuto con uno stato di successo, senza richiedere ai chiamanti di confrontare il testo del messaggio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The way the --help text is parsed the message is returned in the same field as an actual parsing error, and the return code is the same as if it was a failure case. However a user actually passing --help explicitly should be considered a success.
The only way I came up with to work around this was to test the error string for :match("^Usage:") and switch gears from error handling to closing with a success status after the message. There really should be a more ergonomic way to do this. As it is most lua apps that implement CLIs with this library return a failure code when they should not.
c.f. https://github.com/orhun/halp/issues/20
c.f. https://github.com/sile-typesetter/sile/pull/1737/files
c.f. https://github.com/lunarmodules/busted/pull/732
c.f. https://github.com/lunarmodules/busted/pull/733#discussion_r1429943388
- Lingua principale
- Lua
- Stelle
- 129
- Fork
- 26
- Merge medio
- 1h 41m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 lunarmodules/lua_cliargs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lunarmodules/lua_cliargs#85 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 48/100
lunarmodules/lua_cliargs#70 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
lunarmodules/lua_cliargs#69 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
lunarmodules/lua_cliargs#68 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
lunarmodules/lua_cliargs#67 ·
Tutte le issue di lunarmodules/lua_cliargs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
HenrikBengtsson/CBI-software#134 ·
-
Nmap
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
secondlife/slua#96 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100