Refactor InfrastructureAgent code to add help command

This commit is contained in:
Simon Larsen
2024-05-13 21:22:49 +01:00
parent db0aee6c0f
commit c7f62fac65
2 changed files with 4 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ func main() {
svcConfig := &service.Config{
Name: "oneuptime-infrastructure-agent",
DisplayName: "OneUptime Infrastructure Agent",
Description: "The OneUptime Infrastructure Agent (Golang Version) is a lightweight, open-source agent that collects system metrics and sends them to the OneUptime platform. It is designed to be easy to install and use, and to be extensible.",
Description: "The OneUptime Infrastructure Agent is a lightweight, open-source agent that collects system metrics and sends them to the OneUptime platform. It is designed to be easy to install and use, and to be extensible.",
Arguments: []string{"run"},
}
@@ -174,6 +174,9 @@ func main() {
if cmd == "stop" {
slog.Info("Service Stopped")
}
// add help command
case "help":
fmt.Println("Usage: oneuptime-infrastructure-agent install | uninstall | start | stop | restart")
default:
slog.Error("Invalid command")
os.Exit(2)

Binary file not shown.