forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.go
27 lines (23 loc) · 801 Bytes
/
command.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package commandregistry
import (
"code.cloudfoundry.org/cli/cf/flags"
"code.cloudfoundry.org/cli/cf/requirements"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . Command
type Command interface {
MetaData() CommandMetadata
SetDependency(deps Dependency, pluginCall bool) Command
Requirements(requirementsFactory requirements.Factory, context flags.FlagContext) ([]requirements.Requirement, error)
Execute(context flags.FlagContext) error
}
type CommandMetadata struct {
Name string
ShortName string
Usage []string
Description string
Flags map[string]flags.FlagSet
SkipFlagParsing bool
TotalArgs int //Optional: number of required arguments to skip for flag verification
Hidden bool
Examples []string
}