aboutsummaryrefslogtreecommitdiff
path: root/cmd/forge/main.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:52:04 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:52:04 +0800
commitb4b0d966340ad9c892f8b8912eebc6118eed7482 (patch)
tree0512a6dd5cfc21fbd91a07d31f972aa2a1cf844d /cmd/forge/main.go
parentgit2c: git2c.go -> client.go, a more sensible name (diff)
downloadforge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.gz
forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.zst
forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.zip
Use cmd/forge for the entry point
Diffstat (limited to '')
-rw-r--r--cmd/forge/main.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmd/forge/main.go b/cmd/forge/main.go
new file mode 100644
index 0000000..102f4da
--- /dev/null
+++ b/cmd/forge/main.go
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
+
+package main
+
+import (
+ "flag"
+ "log/slog"
+ "os"
+
+ "go.lindenii.runxiyu.org/forge"
+)
+
+func main() {
+ configPath := flag.String(
+ "config",
+ "/etc/lindenii/forge.scfg",
+ "path to configuration file",
+ )
+ flag.Parse()
+
+ s := forge.Server{}
+
+ s.Setup()
+
+ if err := s.LoadConfig(*configPath); err != nil {
+ slog.Error("loading configuration", "error", err)
+ os.Exit(1)
+ }
+
+ s.Run()
+}