mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
26 lines
364 B
Go
26 lines
364 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
command "github.com/mikefarah/yq/v4/cmd"
|
|
)
|
|
|
|
func main() {
|
|
cmd := command.New()
|
|
|
|
args := os.Args[1:]
|
|
|
|
_, _, err := cmd.Find(args)
|
|
if err != nil {
|
|
// default command when nothing matches...
|
|
newArgs := []string{"eval"}
|
|
cmd.SetArgs(append(newArgs, os.Args[1:]...))
|
|
|
|
}
|
|
|
|
if err := cmd.Execute(); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|