Options shown in Global section can include unreachable alternatives.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by examining the topLevelParser expression in the issue, especially how hsubparser combines subcommands with launchCommand as a fallback. Read the parser-combinator implementation and existing parser tests to determine whether an empty command can be represented separately from global options. Done means launch options are shown only for the no-subcommand path and are rejected or absent for commands such as run.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello 👋🏼
The CLI for Unison has one very common use-case (launching the unison shell) and several other 'utility' commands. The way we have things set up right now is as follows:
ucmwithout any subcommand runs the 'launch' behaviourucm rundefers to therunsubcommand.
The way we've implemented this is by using our launch option parser as a fallback for our subcommand parser:
topLevelParser =
hsubparser subcommands <|> launchCommand
Meaning that if the user doesn't provide a command, we interpret it as a 'launch'.
The issue is that currently optparse-applicative interprets all of the options of launch as global options, even though all of those options will fail if passed to the run subcommand for example.
Is there any way to indicate options as being only relevant if no subcommand is provided, rather than showing them as global?
Effectively I want the empty command to just be treated as another subcommand.
This may not be the most common setup, but if you can think of a way to make this work I'd love to hear it 😄
Thank you for maintaining such an awesome tool, it saves us a lot of time :D
- Lingua principale
- Haskell
- Stelle
- 957
- Fork
- 124
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 pcapriotti/optparse-applicative
-
Allow QuickCheck 2.17Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
pcapriotti/optparse-applicative#524 · 2 commenti ·
-
Allow replacing commands with metavar when using parserOptionGroupForse già presa @tbidne l’ha presa 86 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
pcapriotti/optparse-applicative#523 · 1 commento · 1 reazione ·
-
Nushell CompletionsAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
pcapriotti/optparse-applicative#513 · 4 commenti ·
Tutte le issue di pcapriotti/optparse-applicative
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
IntersectMBO/cardano-ledger#6276 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenZeppelin/canton-contracts#92 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
hasura/graphql-engine#10954 ·
I maintainer di solito rispondono entro 1 giorno