Console option processing
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- cli, documentation
Direzione di ricerca
Inizia leggendo Options.cs e rivedendo la visualizzazione della guida delle opzioni nella console e la documentazione online a cui si fa riferimento nell’issue. Documenta i prefissi delle opzioni e i separatori tra opzioni e valori supportati, incluse le distinzioni rilevanti e il comportamento descritto nei commenti esistenti, in modo che il testo della guida e la documentazione online siano coerenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
@oznetmaster commented on Thu Mar 19 2015
In the help display for the console options, every option is prefaced by --. Also, the all show an = as the separator for option and value.
However, Options.cs indicates in its internal documentation:
// Options are extracted either from the current option by looking for
// the option name followed by an '=' or ':', or is taken from the
// following option IFF:
// - The current option does not contain a '=' or a ':'
// - The current option requires a value (i.e. not a Option type of ':')
//
// The `name' used in the option format string does NOT include any leading
// option indicator, such as '-', '--', or '/'. All three of these are
// permitted/required on any named option.
//
// Option bundling is permitted so long as:
// - '-' is used to start the option group
// - all of the bundled options are a single character
// - at most one of the bundled options accepts a value, and the value
// provided starts from the next character to the end of the string.
//
// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'
// as '-Dname=value'.
//
// Option processing is disabled by specifying "--". All options after "--"
// are returned by OptionSet.Parse() unchanged and unprocessed.
This indicates that either = or : can be used to separate options from their values, and that each option should start with a single -, not --. In fact, it appears that a -- will actually inhibit further option processing.
This has left me very confused. I have always used a single - in front of the option anme, and always used a : to separate options from their values.
Is this a documentation issue (both the help text and the online documentation), or is it a functional/implementation issue?
@CharliePoole commented on Thu Mar 19 2015
Yes, = or : are both available. They may be used interchangeably on the command-line, although they have different meanings when used in the option definition.
Option bundling is a feature that comes to us from Linux, where the distinction between - and -- is quite important. It's a bit confusing to Windows users, so we haven't said much about it in the help.
In fact, we only have two single-character options, -v and -h. Neither of them take an argument. You can type nunit-console -vh or nunit-console -hv and the help is displayed. If you use --vh, that's invalid. You can also use -help and --help (or /help on Windows).
All of this is the fallout of the fact that we are using a general-purpose class for our command-line options. Mono.Options is widely used in open source mono and .NET applications and it has a lot more capability than we use at the moment.
If you'd like to propose some changes in how we explain (or don't explain) this to the users, please assign this issue to yourself and write up what you think we should do here.
@oznetmaster commented on Thu Mar 19 2015
Something is very confused here. When I use single hyphen options (for EVERY option) they work perfectly. When I use double hyphen, they do not work! Which seems to agree with the documentation in the options.cs help file.
@CharliePoole commented on Thu Mar 19 2015
Yes, single hyphen should work for every option. Double-hyphen should work as well. What doesn't work?
@oznetmaster commented on Thu Mar 19 2015
Apparently the issue is that I left a space between the – and the option name (accidently), and that has a whole different meaning :(
Also, I discovered that / can also be used to specify the option.
I will think on how to document this. Perhaps it should only be in the online documentation, and not the help text.
@rprouse commented on Thu Mar 19 2015
@oznetmaster, can we close this now? It is fairly common for other programs that I know of to accept variants of - -- and / for the command lines. Is there still an issue?
@oznetmaster commented on Thu Mar 19 2015
This is a documentation issue. That is what is being discussed now. Neither the option prefix, nor the option/value separator, is documented correctly. And I use many programs in which no variants are accepted for either item, so documentation does seem in order here.
@rprouse commented on Thu Mar 19 2015
OK, I've labelled the issue accordingly.
- Lingua principale
- Dockerfile
- Stelle
- 601
- Fork
- 159
- Merge medio
- 22h 18m
- PR unite (30g)
- 6
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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.
Altre issue di nunit/docs
-
area:adapter type:newpage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Document why output from ASP.NET Core handlers (WebApplicationFactory) is not captured, and the workaroundsForse già presa @SeanKilleen l’ha presa 36 giorni fa. Apertaarea:framework type:update
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
-
type:newpage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Dependency DashboardAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 15/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Issue simili
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pbakaus/impeccable#1718 ·
I maintainer di solito rispondono entro 1 giorno
-
Unknown option '--format'Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Mcrich23/Container-Compose#197 ·
I maintainer di solito rispondono entro 1 giorno
-
area: cli
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vitruv-tools/NeoJoin#430 ·
I maintainer di solito rispondono entro 1 giorno
-
milestone-3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Harsha0912/recall#65 ·
I maintainer di solito rispondono entro 1 giorno
-
bug difficulty:1
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
MakazhanAlpamys/Soup#3532 ·
I maintainer di solito rispondono entro 1 giorno