github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/commandregistry/command.go (about)

     1  package commandregistry
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/cf/flags"
     5  	"code.cloudfoundry.org/cli/cf/requirements"
     6  )
     7  
     8  //go:generate counterfeiter . Command
     9  
    10  type Command interface {
    11  	MetaData() CommandMetadata
    12  	SetDependency(deps Dependency, pluginCall bool) Command
    13  	Requirements(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error)
    14  	Execute(context flags.FlagContext) error
    15  }
    16  
    17  type CommandMetadata struct {
    18  	Name            string
    19  	ShortName       string
    20  	Usage           []string
    21  	Description     string
    22  	Flags           map[string]flags.FlagSet
    23  	SkipFlagParsing bool
    24  	TotalArgs       int //Optional: number of required arguments to skip for flag verification
    25  	Hidden          bool
    26  	Examples        []string
    27  }