From 0e83c3f2f964e9f26f25e77cb2fbf648c0fce5fa Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 14 Nov 2023 15:54:19 +0100 Subject: [PATCH] remove old main function --- cmd/ipfs/kubo/start.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cmd/ipfs/kubo/start.go b/cmd/ipfs/kubo/start.go index 13fad8387..c60850d4b 100644 --- a/cmd/ipfs/kubo/start.go +++ b/cmd/ipfs/kubo/start.go @@ -84,16 +84,6 @@ func LoadPlugins(repoPath string, preload PluginPreloader) (*loader.PluginLoader return plugins, nil } -// main roadmap: -// - parse the commandline to get a cmdInvocation -// - if user requests help, print it and exit. -// - run the command invocation -// - output the response -// - if anything fails, print error, maybe with help. -func main() { - os.Exit(Start(BuildDefaultEnv)) -} - func printErr(err error) int { fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error()) return 1 @@ -158,6 +148,12 @@ func BuildEnv(pl PluginPreloader) func(ctx context.Context, req *cmds.Request) ( } } +// Start roadmap: +// - parse the commandline to get a cmdInvocation +// - if user requests help, print it and exit. +// - run the command invocation +// - output the response +// - if anything fails, print error, maybe with help. func Start(buildEnv func(ctx context.Context, req *cmds.Request) (cmds.Environment, error)) (exitCode int) { ctx := logging.ContextWithLoggable(context.Background(), newUUID("session"))