Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlagParser single letter options dependent on order of flags. #22176

Closed
mike-ward opened this issue Sep 7, 2024 · 0 comments · Fixed by #22242
Closed

FlagParser single letter options dependent on order of flags. #22176

mike-ward opened this issue Sep 7, 2024 · 0 comments · Fixed by #22242
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@mike-ward
Copy link
Contributor

mike-ward commented Sep 7, 2024

Describe the bug

Using https://github.com/mike-ward/lsv as an example.

Changing the order of single letter flags will cause an error claiming one of the flags is unrecognized. Example:

lsv -gl => unknown flag -l
lsv -lg => ok

lsv -sr => unknown flag -r
lsv -rs => ok

Reproduction Steps

clone https://github.com/mike-ward/lsv
cd lsv
make lsv
bin/lsv -gl

Expected Behavior

List contents of the directory.

Current Behavior

unknown flag -l

Possible Solution

Seems to happen with any two single letter flags where the flags are ordered reverse alphabetical.

Additional Information/Context

This flags could be listed in any order before I updated to weekly.2024.36

V version

V 0.4.7 620e064

Environment details (OS name and version, etc.)

V full version: V 0.4.7 8215f21.620e064
OS: macos, macOS, 14.6.1, 23G93
Processor: 8 cpus, 64bit, little endian, Apple M2

getwd: /Users/mike/Documents/github/lsv
vexe: /Users/mike/Documents/github/v/v
vexe mtime: 2024-09-07 14:49:17

vroot: OK, value: /Users/mike/Documents/github/v
VMODULES: OK, value: /Users/mike/.vmodules
VTMP: OK, value: /tmp/v_501

Git version: git version 2.46.0
Git vroot status: weekly.2024.32-142-g620e0641 (2 commit(s) behind V master)
.git/config present: true

CC version: Apple clang version 15.0.0 (clang-1500.3.9.4)
thirdparty/tcc status: thirdparty-macos-arm64 5c1d002f

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@mike-ward mike-ward added the Bug This tag is applied to issues which reports bugs. label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant