-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.go
37 lines (34 loc) · 1001 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
28
29
30
31
32
33
34
35
36
37
package command
import (
"context"
"github.com/foomo/posh/pkg/prompt/goprompt"
"github.com/foomo/posh/pkg/readline"
)
type (
Command interface {
Name() string
Description() string
Execute(ctx context.Context, r *readline.Readline) error
}
Helper interface {
Help(ctx context.Context, r *readline.Readline) string
}
Validator interface {
Validate(ctx context.Context, r *readline.Readline) error
}
Completer interface {
Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}
FlagCompleter interface {
CompleteFlags(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}
ArgumentCompleter interface {
CompleteArguments(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}
PassThroughFlagsCompleter interface {
CompletePassTroughFlags(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}
AdditionalArgsCompleter interface {
CompleteAdditionalArgs(ctx context.Context, r *readline.Readline) []goprompt.Suggest
}
)