mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
29 lines
466 B
Go
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)
|
|
}
|
|
}
|