Files
yq/yq.go
Adrian Thurston d066451852 chore: rewrote paths so we reference the fork only
It seems it should be possible to use a replace in go mod to avoid rewriting,
but I couldn't make it work when running go install. I get the feeling there is
some magic thing to do that I wasn't getting.
2022-06-16 10:15:10 -07:00

26 lines
397 B
Go

package main
import (
"os"
command "github.com/adrian-thurston/yq/v4/cmd"
)
func main() {
cmd := command.New()
args := os.Args[1:]
_, _, err := cmd.Find(args)
if err != nil && args[0] != "__complete" {
// default command when nothing matches...
newArgs := []string{"eval"}
cmd.SetArgs(append(newArgs, os.Args[1:]...))
}
if err := cmd.Execute(); err != nil {
os.Exit(1)
}
}