exec without -- takes --version and --help after the SDK name as vfox's own flags
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 45/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 4k
- Forks
- 177
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 31
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from version-fox/vfox
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
version-fox/vfox#825 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
version-fox/vfox#823 ·
Maintainers usually reply within 1 day
-
Plugins fail to load when the HOME path contains ';' or '?' (Lua package.path)Possibly taken @Xnadir claimed this today. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
version-fox/vfox#821 ·
Maintainers usually reply within 1 day
-
[BUG]: the Available cache ignores the environment, so one setting's list is shown for anotherPossibly taken @nanami7777777 claimed this today. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 25/100
version-fox/vfox#816 ·
Maintainers usually reply within 1 day
-
[Feature]: treat two names of one install as the same versionPossibly taken @Detoy claimed this today. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 30/100
version-fox/vfox#814 ·
Maintainers usually reply within 1 day
All issues in version-fox/vfox
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
seaweedfs/seaweed-block#443 ·
Maintainers usually reply within 1 day
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encodePossibly taken @Indian-boult claimed this today. Openbug queries
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ClickHouse/clickhouse-go#2155 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
transparency-dev/tessera#1286 ·
Maintainers usually reply within 1 day