-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
watch flag breaks backend option #24571
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
Comments
Connected to Huly®: V_0.6-22936 |
According to the documentation, all options should be placed in the beginning: $ v help
V is a tool for managing V source code.
Usage:
v [options] [command] [arguments] This works: v -backend js_browser watch file.v |
Works, thanks. Closing the issue. |
It should stay open until we have a better error message. The problem is that The 2nd problem is that it is also doing something weird with that parameter, since it prints it back out with the Very strange... |
It's confusing, but it's not really a bug. Simply execute the following command: $ v watch -help
v watch 0.0.2
-----------------------------------------------
Usage: v watch [options] [--silent] [--clear] [--ignore .db] [--add /path/to/a/file.v] [run] program.v
Description: Collect all .v files needed for a compilation, then re-run the compilation when any of the source changes.
Options:
--vwatchworker Internal flag. Used to distinguish vwatch manager and worker processes.
-s, --silent Be more silent; do not print the watch timestamp before each re-run.
-c, --clear Clears the terminal before each re-run.
-k, --keep Keep the program running. Restart it automatically, if it exits by itself. Useful for gg/ui apps.
-a, --add <string> Add more files to be watched. Useful with `v watch --add=/tmp/feature.v run cmd/v /tmp/feature.v`, if you change *both* the compiler, and the feature.v file.
-i, --ignore <string> Ignore files having these extensions. Useful with `v watch --ignore=.db run server.v`, if your server writes to an sqlite.db file in the same folder.
-o, --only-watch <string>
Watch only files matching these globe patterns. Example for a markdown renderer project: `v watch --only-watch=*.v,*.md run .`
-h, --help Show this help screen.
--before <string> A command to execute *before* each re-run.
--after <string> A command to execute *after* each re-run. The This is the correct usage: v [v-options] watch [watch-options] file.v For example: v -backend js_browser watch -ck file.v |
It is a bug, in that it the message given didn't make any sense. Useless error messages are almost worse than none at all. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Without watch flag, compilation to js backend works.
With watch flag, it gives an error:
Unknown argument
-baend``Reproduction Steps
Given this single-file program:
Compile it with:
v watch -backend js_browser file.v
Expected Behavior
Program is compiled and watch starts.
Current Behavior
Error:
Unknown argument
-baend``Possible Solution
So there is some args parsing issue when using watch option.
Additional Information/Context
When omitting the
watch
option, the above command starts working correctly.Also, replacing
-backend
with-b
in the above command makes the compilation work.But
-b
doesn't set the correct backend (probably another bug). It works correctly for-b js
, but when used with-b js_browser
it sets backend tojs
(notjs_browser
).V version
0.4.10 22c327f
Environment details (OS name and version, etc.)
Mac OS Sonoma 14.3.1
The text was updated successfully, but these errors were encountered: