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

BUILD(shared): build CLI11 into shared target #6243

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WOLFI3654
Copy link
Contributor

Implements #6063

Checks

@WOLFI3654
Copy link
Contributor Author

Just started working on this. There are two questions I already have:

  1. How are translations handled for the flags itself and the flag descriptions?
  2. Should be flags be rewritten to follow general cli standards? from my understanding "-third-party-licenses" would be a bit odd since the single dash is mostly only used for shorthands ( in this case something like -tpl)

@WOLFI3654
Copy link
Contributor Author

2. Should be flags be rewritten to follow general cli standards?

Probably interesting for this as well: CLI11 does not permit single args that have more than one character

@WOLFI3654
Copy link
Contributor Author

Also I am having difficulties getting --help to work under windows. It looks like this never really worked in the first place.

@Hartmnt
Copy link
Member

Hartmnt commented Oct 20, 2023

  1. How are translations handled for the flags itself and the flag descriptions?

It looks like neither flags nor descriptions are currently translated. I would say translating the flags itself is not something we want. Translating the descriptions would make sense, but it would require to wrap all descriptions into QObject::tr() call. The actual translations are then community created outside of this MR - once it is merged.

  1. Should be flags be rewritten to follow general cli standards? from my understanding "-third-party-licenses" would be a bit odd since the single dash is mostly only used for shorthands ( in this case something like -tpl)

I would say yes, except when you encounter something that could potentially break servers or their automation. In that case we should look at that again in particular.

But, let's also have input from @Krzmbrzl for that

@WOLFI3654
Copy link
Contributor Author

I would say yes, except when you encounter something that could potentially break servers or their automation. In that case we should look at that again in particular.

I'd say most of these are breaking since single dash is forbidden for multicharacter options. And on server side, most of the options are.

@WOLFI3654 WOLFI3654 force-pushed the feat/server/cli-11 branch 5 times, most recently from b085481 to 275f275 Compare October 21, 2023 18:50
@Krzmbrzl
Copy link
Member

How are translations handled for the flags itself and the flag descriptions?

Flags should definitely not be translated. Their description don't need to be translated either imo - though this is open for discussion. Maybe omitting translation for now and then looking into that once requested would be an OK approach?

Should be flags be rewritten to follow general cli standards? from my understanding "-third-party-licenses" would be a bit odd since the single dash is mostly only used for shorthands ( in this case something like -tpl)

Yes - I think CLI11 doesn't even support non standard flags 👀

Also I am having difficulties getting --help to work under windows. It looks like this never really worked in the first place.

That might very well be the case - on Windows Mumble essentially never gets started from a command line.

It looks like neither flags nor descriptions are currently translated.

The description is currently translated - which is a massive PITA if you ask me as the help text is translated in its entirety.

@WOLFI3654
Copy link
Contributor Author

Yes - I think CLI11 doesn't even support non standard flags 👀

Thank you, yeah, this confirms what I figured. So this whole MR will basically be a breaking change for anyone using the CLI in automation. Unless we add some kind of mapping layer that will sort of “up cast” the old parameters to the new system. Is that something we should go for to smooth out the transition or do we just roll with the break, since the jump from 1.4 to 1.5 would be a somewhat good opportunity to refactor / re-think the CLI.

@Krzmbrzl
Copy link
Member

I would roll with the break as I don't think maintaining support for non-standard flags makes sense for the future, so eventually we'll have to make a break (or keep the mess of manual option handling that we currently have) 🤔

since the jump from 1.4 to 1.5 would be a somewhat good opportunity to refactor / re-think the CLI.

This PR won't be part of 1.5 anymore, but 1.6 will do equally fine :)

@WOLFI3654 WOLFI3654 force-pushed the feat/server/cli-11 branch 3 times, most recently from 19349a6 to 12dd794 Compare October 27, 2023 16:31
3rdparty/CLI11 Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should stick to tagged releases of CLI11 - the latest of these would be https://github.com/CLIUtils/CLI11/releases/tag/v2.3.2 as of this writing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submodule should be put at head of tag now

@@ -234,6 +234,8 @@ else()
endif()
endif()

target_link_libraries(shared PUBLIC CLI11::CLI11)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the dependency to the client and the server explicitly - the shared target really should only have dependencies for the shared code and not dependencies that both components happen to create in their own code respectively.

Comment on lines 19 to 20
#include <boost/logic/tribool.hpp>
#include <boost/optional/optional_io.hpp>
#include <boost/tuple/tuple_io.hpp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, I would like to stick to std-types. If that would make things a lot more complicated, stick to using Boost though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using std types and experienced some issues since they are not always available depending on which target system is built. Yeah boost is quite expensive to compile, I agree - not using them would be better. I'll try to see if I can remove them after things work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std-types should always present. You only have to check to stick to std types included in up to cpp14 as that's the current standard we are using.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, std::optional is not avalable in cpp14 afaik. I'll try to find another solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but an empty string will do equally fine for indicating that the INI file has not been specified :)

src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
src/murmur/main.cpp Outdated Show resolved Hide resolved
@WOLFI3654 WOLFI3654 force-pushed the feat/server/cli-11 branch 8 times, most recently from 225e3f4 to 74a1803 Compare November 11, 2023 18:10
@Krzmbrzl Krzmbrzl added client server feature-request This issue or PR deals with a new feature labels Feb 18, 2024
@Hartmnt
Copy link
Member

Hartmnt commented May 31, 2024

What is the state on this?

@WOLFI3654
Copy link
Contributor Author

Hi — sorry, I kinda forgot about this.
From the looks of it I believe it was functional and working. If I remember correctly only thing "left" todo is to remove the need for boost

@WOLFI3654 WOLFI3654 force-pushed the feat/server/cli-11 branch from 74a1803 to 5b718a0 Compare May 31, 2024 13:47
@Hartmnt
Copy link
Member

Hartmnt commented May 31, 2024

Hi — sorry, I kinda forgot about this. From the looks of it I believe it was functional and working. If I remember correctly only thing "left" todo is to remove the need for boost

Nice :)
Do you have the time and motivation to finalize this MR by any chance? (no pressure)

@WOLFI3654
Copy link
Contributor Author

My time is sadly quite limited at the moment, and I don't know for sure when I could get around to it. I can try to look at it again in a few weeks (motivation is there), but no idea when you want this to be done :D

@Hartmnt
Copy link
Member

Hartmnt commented May 31, 2024

My time is sadly quite limited at the moment, and I don't know for sure when I could get around to it. I can try to look at it again in a few weeks (motivation is there), but no idea when you want this to be done :D

Since this will not make it as a backport in 1.5.x, there is a lot of time left until we need this :D So you can take your time. I just wanted to make sure this was not entirely abandoned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client feature-request This issue or PR deals with a new feature server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants