Fix deadlock at container finish.
[lightning.git] / cmd.go
diff --git a/cmd.go b/cmd.go
index 710080f97b271eaf88cadaa4602c9bf400e4803b..b10b1caa3fc4a65531de88e6818013a628380494 100644 (file)
--- a/cmd.go
+++ b/cmd.go
@@ -10,6 +10,8 @@ import (
        "io/ioutil"
        "os"
        "os/exec"
+       "runtime/debug"
+       "strings"
 
        "git.arvados.org/arvados.git/lib/cmd"
        "github.com/mattn/go-isatty"
@@ -29,6 +31,9 @@ var (
                "export":             &exporter{},
                "export-numpy":       &exportNumpy{},
                "flake":              &flakecmd{},
+               "slice":              &slicecmd{},
+               "slice-numpy":        &sliceNumpy{},
+               "anno2vcf":           &anno2vcf{},
                "numpy-comvar":       &numpyComVar{},
                "filter":             &filtercmd{},
                "build-docker-image": &buildDockerImage{},
@@ -42,10 +47,19 @@ var (
        })
 )
 
+func init() {
+       if os.Getenv("GOGC") == "" {
+               debug.SetGCPercent(30)
+       }
+}
+
 func Main() {
        if !isatty.IsTerminal(os.Stderr.Fd()) {
                logrus.StandardLogger().Formatter = &logrus.TextFormatter{DisableTimestamp: true}
        }
+       if len(os.Args) >= 2 && !strings.HasSuffix(os.Args[1], "version") {
+               cmd.Version.RunCommand("lightning", nil, nil, os.Stderr, os.Stderr)
+       }
        os.Exit(handler.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
 }