remove old main function
Steven Allen committed
Nov 14, 2023 at 15:54 UTC
0e83c3f2f964e9f26f25e77cb2fbf648c0fce5fa
1 file changed
+6
-10
cmd/ipfs/kubo/start.go
+6
-10
@@ -84,16 +84,6 @@ func LoadPlugins(repoPath string, preload PluginPreloader) (*loader.PluginLoader
84
return plugins, nil
85
}
86
87
-// main roadmap:
88
-// - parse the commandline to get a cmdInvocation
89
-// - if user requests help, print it and exit.
90
-// - run the command invocation
91
-// - output the response
92
-// - if anything fails, print error, maybe with help.
93
-func main() {
94
- os.Exit(Start(BuildDefaultEnv))
95
-}
96
-
87
func printErr(err error) int {
88
fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error())
89
return 1
@@ -158,6 +148,12 @@ func BuildEnv(pl PluginPreloader) func(ctx context.Context, req *cmds.Request) (
148
}
149
}
150
151
+// Start roadmap:
152
+// - parse the commandline to get a cmdInvocation
153
+// - if user requests help, print it and exit.
154
+// - run the command invocation
155
+// - output the response
156
+// - if anything fails, print error, maybe with help.
157
func Start(buildEnv func(ctx context.Context, req *cmds.Request) (cmds.Environment, error)) (exitCode int) {
158
ctx := logging.ContextWithLoggable(context.Background(), newUUID("session"))
159