github.com/palantir/godel-dep-plugin@v1.1.1-0.20201218041358-274eaa9b1310/cmd/root.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 cmd
     6  
     7  import (
     8  	"github.com/palantir/godel/framework/pluginapi"
     9  	"github.com/palantir/pkg/cobracli"
    10  	"github.com/spf13/cobra"
    11  )
    12  
    13  var (
    14  	debugFlagVal  bool
    15  	verifyFlagVal bool
    16  )
    17  
    18  var rootCmd = &cobra.Command{
    19  	Use:   "dep-plugin [flags] [files]",
    20  	Short: "Run dep",
    21  }
    22  
    23  func Execute() int {
    24  	return cobracli.ExecuteWithDebugVarAndDefaultParams(rootCmd, &debugFlagVal)
    25  }
    26  
    27  func init() {
    28  	pluginapi.AddDebugPFlagPtr(rootCmd.PersistentFlags(), &debugFlagVal)
    29  }