aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/service_cmd.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-08-28 14:40:03 +0200
committerDan Engelbrecht <[email protected]>2025-01-08 10:01:23 +0100
commit54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09 (patch)
tree457c7c404bdbe7486e37bd8c699ed5716c7513e0 /src/zen/cmds/service_cmd.cpp
parentclang format (diff)
downloadarchived-zen-54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09.tar.xz
archived-zen-54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09.zip
Add ServiceSpec struct
Diffstat (limited to 'src/zen/cmds/service_cmd.cpp')
-rw-r--r--src/zen/cmds/service_cmd.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/zen/cmds/service_cmd.cpp b/src/zen/cmds/service_cmd.cpp
index a93bac37c..51b41f2a0 100644
--- a/src/zen/cmds/service_cmd.cpp
+++ b/src/zen/cmds/service_cmd.cpp
@@ -211,15 +211,17 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
}
ZEN_CONSOLE(
"Service '{}':\n"
- " Status: {}\n"
- " Executable: '{}'\n"
- " Display Name: '{}'\n"
- " Description: '{}'",
+ " Status: {}\n"
+ " Executable: {}\n"
+ " CommandLineOptions: {}\n"
+ " Display Name: {}\n"
+ " Description: {}",
m_ServiceName,
ToString(Info.Status),
- Info.ExecutablePath,
- Info.DisplayName,
- Info.Description);
+ Info.Spec.ExecutablePath,
+ Info.Spec.CommandLineOptions,
+ Info.Spec.DisplayName,
+ Info.Spec.Description);
}
if (SubOption == &m_InstallOptions)
@@ -238,11 +240,11 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
}
m_ServerExecutable = std::filesystem::absolute(m_ServerExecutable);
- std::error_code Ec = InstallService(m_ServerExecutable,
- GlobalOptions.PassthroughCommandLine,
- m_ServiceName,
- m_ServiceDisplayName,
- m_ServiceDescription);
+ std::error_code Ec = InstallService(m_ServiceName,
+ ServiceSpec{.ExecutablePath = m_ServerExecutable,
+ .CommandLineOptions = GlobalOptions.PassthroughCommandLine,
+ .DisplayName = m_ServiceDisplayName,
+ .Description = m_ServiceDescription});
if (Ec)
{
ZEN_CONSOLE("Failed to install service '{}' using '{}' . Reason: '{}'", m_ServiceName, m_ServerExecutable, Ec.message());