scm: support --listen flag for uds

Support the --listen flag to mu scm, to start listening on a Unix domain socket.
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-16 20:28:00 +03:00
parent 8c706a77db
commit e56c848952
6 changed files with 52 additions and 15 deletions

View File

@ -632,8 +632,11 @@ sub_server(CLI::App& sub, Options& opts)
static void
sub_scm(CLI::App& sub, Options& opts)
{
sub.add_flag("--listen", opts.scm.listen,
"Start listening on a domain socket");
sub.add_option("script-path", opts.scm.script_path, "Path to script")
->type_name("<path>");
->type_name("<path>")
->excludes("--listen");
sub.add_option("script-args", opts.scm.params, "Parameters for script")
->type_name("<parameters>");
}

View File

@ -259,6 +259,7 @@ struct Options {
struct Scm {
OptString script_path; /**< Path to script (optional) */
StringVec params; /**< Parameters for script (after "--") */
bool listen; /**< Whether to start listening on a socket */
} scm;