-
Notifications
You must be signed in to change notification settings - Fork 501
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
sokol_args: support single keys for native apps #876
Comments
Agreed, I was actually missing it too a couple of times. It should essentially be a shortcut for boolean args ( |
Hmm ok, on the web it works by accident, because the Lines 723 to 724 in 751fc4c
I'll see if I can fix the 'native' arg parser function to work the same way. PS: I probably still need to change behaviour a bit, because currently |
Ok, fixed via #896 See the updated documentation for caveats (key-only args have an empty value string, but can be checked with Also check the updated tests ( sokol/tests/functional/sokol_args_test.c Lines 256 to 302 in 10f2c9c
|
Thanks for improving this @floooh ! |
I am using
sokol_args.h
as a library to handle command line arguments in an apps that can be compiled to WebAssembly or native (Linux in my case).When I use
emrun myapp.html -- -myarg
, while the argument-myarg
is listed for WebAssembly, it's omitted in native, so there is a different behavior between native and WebAssembly.I noticed this comment in
sokol_args.h
:Actually single keys works in WebAssembly, but not in native yet, I guess this behavior was not really defined in the library. I think the library should start defining this, so native could be improved to handle single key arguments like WebAssembly is.
The text was updated successfully, but these errors were encountered: