Updated code structure using new Cobra CLI conventions

This commit is contained in:
2026-05-31 17:10:31 -05:00
parent c50388a38c
commit efc9eeb536
3 changed files with 92 additions and 69 deletions
+4 -4
View File
@@ -180,16 +180,16 @@ func TestMainHelperProcess(t *testing.T) {
_ = proc.Signal(os.Interrupt)
}
}()
os.Args = []string{"pastebin", "--config", cfgPath}
os.Args = []string{"scratchbox", "server", "--config", cfgPath}
main()
os.Exit(0)
case "bad-config":
os.Args = []string{"pastebin", "--config", "/no/such/config.yaml"}
os.Args = []string{"scratchbox", "server", "--config", "/no/such/config.yaml"}
main()
os.Exit(0)
case "storage-fail":
cfgPath := os.Getenv("MAIN_HELPER_CONFIG")
os.Args = []string{"pastebin", "--config", cfgPath}
os.Args = []string{"scratchbox", "server", "--config", cfgPath}
main()
os.Exit(0)
case "http-fail":
@@ -197,7 +197,7 @@ func TestMainHelperProcess(t *testing.T) {
if err := os.Chdir(t.TempDir()); err != nil {
os.Exit(2)
}
os.Args = []string{"pastebin", "--config", cfgPath}
os.Args = []string{"scratchbox", "server", "--config", cfgPath}
main()
os.Exit(0)
default: