33 lines
511 B
Go
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)
|
|
}
|