exec without -- takes --version and --help after the SDK name as vfox's own flags
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start with the custom version flag in cmd/cmd.go (around lines 49-57), which prints the version and returns nil, and then with the argument handling in cmd/commands/exec.go, where parseExecInvocation runs. Reproduce with vfox exec [email protected] etcd --version and compare it with the -- form. Done means arguments after the command name reach the command unchanged in both forms, with the -- path still working.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The documented form of vfox exec is vfox exec <sdk-name>[@<version>]... -- <command> [args...] (docs/usage/core-commands.md). The form without -- is accepted for one SDK, but an argument of the command that starts with a dash does not reach the command: --version prints the vfox version and the command runs without it, and --help is read as a help topic. This is the same parser problem as #808 (search), in the exec command.
Reproduction on a GitHub-hosted runner (Ubuntu 26.04.1, x86_64) with the vfox 1.1.0 release archive (checksum verified) and the zip archive of the vfox-etcd v0.2.3 tag, with etcd 3.5.12 installed by vfox exec [email protected] -- etcd --version. Run: https://github.com/version-fox/vfox-plus/actions/runs/45057624973 (the -- form also works in the earlier run https://github.com/version-fox/vfox-plus/actions/runs/45056971190)
| Command | Result |
|---|---|
vfox exec [email protected] -- etcd --version |
etcd Version: 3.5.12, exit 0 (control) |
vfox exec [email protected] etcd --version |
stderr 1.1.0; etcd starts with no arguments and keeps running; stopped by timeout after 30 seconds (exit 124) |
vfox exec clang --version (clang not installed) |
stderr 1.1.0, then usage: vfox exec <sdk>[@<version>]... -- <command> [args...], exit 1 |
vfox exec [email protected] etcd --help |
stderr No help topic for '[email protected]', exit 1; etcd's help is not reached |
vfox exec [email protected] etcd version |
passes version to etcd |
vfox --version |
vfox version 1.1.0, exit 0 |
Cause: the custom cli.VersionFlag in cmd/cmd.go:49-57 prints the version and returns nil, so the command carries on. vfox still recognises the flag after the SDK name, so --version is removed before cmd/commands/exec.go:51 reads the arguments. parseExecInvocation then sees [email protected] etcd, which it reads as one SDK and the command etcd with no arguments (exec.go:82-90). For clang --version one argument is left, which gives the usage error. The -- branch avoids this, because it reads the raw arguments (exec.go:63-66).
Expected: the arguments after the command name reach the command, as they do after --. Alternatively, the form without -- refuses an argument that starts with a dash, instead of running a different command.
Possible fix: stop flag parsing at the first argument after the SDK specifications, for example with SkipFlagParsing on the exec command, reading the SDK specifications from the raw arguments as the -- branch does.
- Lingua principale
- Go
- Stelle
- 4k
- Fork
- 177
- Merge medio
- 1g 20h
- PR unite (30g)
- 31
Preparare l'ambiente
- 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 version-fox/vfox
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
version-fox/vfox#825 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
version-fox/vfox#823 ·
I maintainer di solito rispondono entro 1 giorno
-
Plugins fail to load when the HOME path contains ';' or '?' (Lua package.path)Forse già presa @Xnadir l’ha presa oggi. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
version-fox/vfox#821 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: the Available cache ignores the environment, so one setting's list is shown for anotherForse già presa @nanami7777777 l’ha presa oggi. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
version-fox/vfox#816 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: treat two names of one install as the same versionForse già presa @Detoy l’ha presa oggi. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
version-fox/vfox#814 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di version-fox/vfox
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
seaweedfs/seaweed-block#443 ·
I maintainer di solito rispondono entro 1 giorno
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encodeForse già presa @Indian-boult l’ha presa oggi. Apertabug queries
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ClickHouse/clickhouse-go#2155 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transparency-dev/tessera#1286 ·
I maintainer di solito rispondono entro 1 giorno