github.com/willmadison/cli@v6.40.1-0.20181018160101-29d5937903ff+incompatible/plugin/rpc/fakecommand/fake_command4.go (about)

     1  package fakecommand
     2  
     3  import (
     4  	"errors"
     5  
     6  	"code.cloudfoundry.org/cli/cf/commandregistry"
     7  	"code.cloudfoundry.org/cli/cf/flags"
     8  	"code.cloudfoundry.org/cli/cf/requirements"
     9  )
    10  
    11  var ErrFakeCommand4 = errors.New("ZOMG command errored")
    12  
    13  type FakeCommand4 struct {
    14  	Data string
    15  }
    16  
    17  func init() {
    18  	commandregistry.Register(FakeCommand4{Data: "FakeCommand4 data"})
    19  }
    20  
    21  func (cmd FakeCommand4) MetaData() commandregistry.CommandMetadata {
    22  	return commandregistry.CommandMetadata{
    23  		Name:        "fake-command4",
    24  		Description: "Description for fake-command4 will error on run",
    25  		Usage: []string{
    26  			"Usage of fake-command4",
    27  		},
    28  	}
    29  }
    30  
    31  func (cmd FakeCommand4) Requirements(_ requirements.Factory, _ flags.FlagContext) ([]requirements.Requirement, error) {
    32  	reqs := []requirements.Requirement{}
    33  	return reqs, nil
    34  }
    35  
    36  func (cmd FakeCommand4) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
    37  	return cmd
    38  }
    39  
    40  func (cmd FakeCommand4) Execute(c flags.FlagContext) error {
    41  	return ErrFakeCommand4
    42  }