-
Notifications
You must be signed in to change notification settings - Fork 123
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
osvr_server support for cmdline options and blank config generation (resolves #228) #293
Conversation
Instead of |
Done! Removed the line from help as well. Quick error check was added to config file creation |
Running Also, instead of creating a file in case someone happens to misspell it, it would be better to construct the server config from the empty JSON string. (This probably entails refactoring |
I think the chance of misspelling is low - it'll be daemonized by most users. Either way, I agree, and the function should be split up |
…absense of config file
👍 Looks good to me. Thanks, @Outurnate! |
There are some conventions for command line parameters, basically the usage of "-" or "--" or "/" makes more sense then only "osvr_server [config file]" Personally I have strong objection about the update, and the previous patch was much better. |
@araujobsd There are conventions for command-line parameters and I believe my comments reflect those conventions. See the fourth paragraph under Standards for Command Line Interfaces from the GNU Coding Standards which also generally reflect the POSIX conventions. |
Yeap, I know that too! Thanks to point it out, my answer was based on POSIX.1-2008 (Utility Conventions). And my main concern is, if in the future we want to extend the options via CLI such like "example": osvr_server --iface=eth1 --ipv4=0.0.0.0 --config=config_file ... looks for me [-c|--config] is more consistent than "osvr_server config_file"; you can argue that all those options shall be passed via config_file and never via CLI, however file as an operand via CLI for my eyes looks strange. Maybe I'm being pedantic. |
@araujobsd The POSIX doc you linked to agrees with my suggestion. The config filename is an operand, to use their terminology. I do envision The syntax for
and an example execution might be:
This usage is much more common than, say, |
Hey, OK, I didn't envision multiple configuration files at once in my previous replies, that is why I was pedantic with it. Actually you don't need But makes sense why you choose that way after your explanation. Thanks. |
Patch to resolve #228. Includes options --config= and --help. Will create config with contents "{ }" in the event that the given config doesn't exist