Files
bkl/cmd/bklb/main.go
T
2026-03-04 21:00:53 -08:00

33 lines
511 B
Go

package main
import (
"fmt"
"os"
"path/filepath"
"runtime/debug"
"strings"
"git.bkl.sh/bkl/bkl/pkg/wrapper"
)
func main() {
debug.SetGCPercent(-1)
cmd := filepath.Base(os.Args[0])
if before, ok := strings.CutSuffix(cmd, "b"); ok {
cmd = before
} else {
fatal(fmt.Errorf(`Usage:
ln -s $(which bklb) toolb # bklb will run 'tool'
See https://bkl.sh/#bklb for detailed documentation.`))
}
wrapper.WrapOrDie(cmd)
}
func fatal(err error) {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}