yq/yq.go
Mike Farah fc5595d0e9 wip
2024-03-12 15:45:08 +11:00

29 lines
466 B
Go

package main
import (
"os"
command "github.com/mikefarah/yq/v4/cmd"
"github.com/mikefarah/yq/v4/pkg/yqlib"
)
func main() {
yqlib.RegisterPropertiesFormat()
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)
}
}