Open Krzmbrzl opened 1 year ago
Hi, I would like to take this up.
If I understand it correctly, the existing code for parsing needs to be replaced with the CLI11 library. I just went through CLI11 and it seems like only one header file needs to be included to use it.
Could you point me to the file where the existing code for parsing is present? Also, if there is anything else apart from the linked comment relevant to this issue that I need to take a look at, could you also mention that?
Thanks
Great to hear that! :+1:
If I understand it correctly, the existing code for parsing needs to be replaced with the CLI11 library. I just went through CLI11 and it seems like only one header file needs to be included to use it.
Exactly. CLI11 can be added as a submodule (git submodule add
) in the 3rdParty
directory and then we only have to tell cmake to include it before referencing it.
Could you point me to the file where the existing code for parsing is present?
Also, if there is anything else apart from the linked comment relevant to this issue that I need to take a look at, could you also mention that?
Nah, nothing particular. Only this: I think you don't (and shouldn't really) worry about porting the non-POSIX-conforming CLI argument style (e.g. only a single dash for long (aka: not only a single letter) options). I think it's about time we made a proper cut here and move to the style that most programs use (in the Unix world anyway). CLI11 should take care of that though, so simply don't try to work around its defaults :D
I would recommend creating a draft pull request early on, so we can have a first glance at it as soon as possible to make sure we all agree on the direction this should take.
Thanks for the reply! I've started working on this (https://github.com/mumble-voip/mumble/pull/6143).
A question I have is how to test the changes that I make. Is being able to successfully build sufficient?
A question I have is how to test the changes that I make. Is being able to successfully build sufficient?
Well, that's a good start but you'll also have to test whether the new CLI options work as intended (either by observing whether they cause Mumble to act accordingly or by introducing printouts to the code to verify that the expected code path is being taken)
I guess with the closing of #6143 this is still on the plate. I'd happily take on.
Context
Currently we are performing manual parsing of command line flag, which incurs extra work on us and leads to non-conforming behavior (to Unix standards). Plus it bloats the main functions and just looks rather horrible.
Description
Instead of doing this manually, we should instead make use of one of the many existing libraries out there. My personal favorite at this point would be https://github.com/CLIUtils/CLI11
Mumble component
Both
OS-specific?
No
Additional information
https://github.com/mumble-voip/mumble/issues/6037#issuecomment-1433305266