apps: Add gclient
This commit is contained in:
parent
ca8306bc35
commit
3750c1da57
@ -40,3 +40,4 @@ luna_app(kill.cpp kill)
|
|||||||
luna_app(gol.cpp gol)
|
luna_app(gol.cpp gol)
|
||||||
luna_app(touch.cpp touch)
|
luna_app(touch.cpp touch)
|
||||||
luna_app(free.cpp free)
|
luna_app(free.cpp free)
|
||||||
|
luna_app(gclient.cpp gclient)
|
||||||
|
20
apps/gclient.cpp
Normal file
20
apps/gclient.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include <os/ArgumentParser.h>
|
||||||
|
#include <os/LocalClient.h>
|
||||||
|
|
||||||
|
Result<int> luna_main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
StringView socket_path = "/tmp/wind.sock";
|
||||||
|
|
||||||
|
os::ArgumentParser parser;
|
||||||
|
parser.add_description("A graphical user interface client."_sv);
|
||||||
|
parser.add_system_program_info("gclient"_sv);
|
||||||
|
parser.add_value_argument(socket_path, 's', "socket"_sv, "the path for the local IPC socket"_sv);
|
||||||
|
parser.parse(argc, argv);
|
||||||
|
|
||||||
|
auto client = TRY(os::LocalClient::connect(socket_path, false));
|
||||||
|
|
||||||
|
StringView message = "hello";
|
||||||
|
TRY(client->send((const u8*)message.chars(), message.length()));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user