dparrish / libcli

Libcli provides a shared library for including a Cisco-like command-line interface into other software. It's a telnet interface which supports command-line editing, history, authentication and callbacks for a user-definable function tree.
https://dparrish.com/link/libcli
GNU Lesser General Public License v2.1
296 stars 149 forks source link

How to use libcli with multiple processes ? #99

Open tsavoritesi-vgarg opened 2 months ago

tsavoritesi-vgarg commented 2 months ago

Hello ,

Hope you are doing well. I am looking at your libcli code in github and have a question. I see the codes and examples where both CLI commands are and cli_loop() part of the same process, and it works fine.

My application has multiple processes listening on the UNIX_AF socket . And I want to provide a single CLI interface to the customer, So do you have any example of how I can implement it ?

Thanks

RobSanders commented 2 months ago

Hi - our use case hasn't worked this way, and the core data structures in libcli do not have any design features to allow for multiple simultaneous but independent instances. My suggestion would be that your listener on the UNIX_AF socket would spawn a new process (not thread) for each independent instance.