-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Boost requirement #41
Comments
Thank you. |
I recently replaced Boost.Asio (to get rid of the dependency on the compiled Boost.System library it uses) in a project. It was really straightforward, since Asio is pretty much a drop-in replacement aside from changing the namespace for functions and using things like std::error instead of the boost::system error. |
Great. I knew already Asio, maybe I'm gonna do some experiment in a branch. |
you can drop the parser too and build interactivity upon this: https://github.com/CLIUtils/CLI11 |
It was pretty straightforward to remove any boost requirement from cli.h - just replacement of boost::lexical_cast with a simple std::istringstream version. I was then able to hook it up to my own socket server. I've attached a diff - note that this has only been tested with VS2015 and then only slightly - YMMV. But it might be a good starting point for officially removing the boost requirement - or at least making it optional. |
@jhndnnqsc yes, as one can see from your patch, removing boost from I guess the hard work would be removing boost from the telnet server. I won't put an implementation of mine because really don't want to face all the issues with multiplatform socket programming. |
The Boost Software License has less requirements to comply with the license than BSD (at least 2 and 3 clause variants), and doesn't have the vagueness regarding binaries that the MIT license has. It let's you copy/use/modify the software for anything you want (commercial or non-commercial) without a fee, so it can be copied/redistributed (git submodule or git subtree might make managing a copy of Asio in your repository easier). To follow the copyright notice requirements:
|
I think removing the boost requirement from cli.h is useful even if you do have to supply your own telnet or ssh server. At least in my case - I already have a libevent based telnet server in my software and don't wish to add a boost requirement just to hook up to my server. |
Ok, I'll see what I can do here. The ideal solution for me would be: make the cli using a generic communication server (not necessarily telnet, BTW) that could be:
The boost server will be implemented in a separated header file so the boost dependency will disappear if it's not used. What do you think? Could be a good solution for you? |
I think that would work. If what was passed into Session was a wrapper for a socket that could either contain a boost socket or some other socket that implemented the same functionality I think that would work for me. As a data point, here's an idea of what my socket interface looks like that I would like to swap the boost implementation for class tcp_socket_t |
@jhndnnqsc well, actually I was oriented more towards an interface of higher level than sockets, e.g., transform |
That would work as well. As long as code like what's in remotecli.h can be shared since you've already figured out the tricky bits of dealing with a telnet connection and it'd be great to reuse those. |
It looks like using Asio standalone instead of Another option for |
Nice work! How much would be needed to remove the boost dependency?
The text was updated successfully, but these errors were encountered: