github.com/palantir/godel-dep-plugin@v1.1.1-0.20201218041358-274eaa9b1310/main.go (about)

     1  // Copyright (c) 2018 Palantir Technologies Inc. All rights reserved.
     2  // Use of this source code is governed by the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"os"
     9  
    10  	"github.com/palantir/amalgomate/amalgomated"
    11  	"github.com/palantir/godel/framework/pluginapi/v2/pluginapi"
    12  
    13  	"github.com/palantir/godel-dep-plugin/cmd"
    14  	amalgomateddep "github.com/palantir/godel-dep-plugin/generated_src"
    15  )
    16  
    17  func main() {
    18  	if len(os.Args) >= 2 && os.Args[1] == amalgomated.ProxyCmdPrefix+"dep" {
    19  		os.Args = append(os.Args[:1], os.Args[2:]...)
    20  		amalgomateddep.Instance().Run("dep")
    21  		os.Exit(0)
    22  	}
    23  	if ok := pluginapi.InfoCmd(os.Args, os.Stdout, cmd.PluginInfo); ok {
    24  		return
    25  	}
    26  	os.Exit(cmd.Execute())
    27  }