forked from posener/complete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeprecated.go
55 lines (48 loc) · 1.35 KB
/
deprecated.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package complete
import (
"github.com/coxley/complete/args"
"github.com/coxley/complete/command"
"github.com/coxley/complete/predict"
)
var (
// Deprecated: See [predict.Or]
PredictOr = predict.Or
// Deprecated: See [predict.Nothing]
PredictNothing = predict.Nothing
// Deprecated: See [predict.Anything]
PredictAnything = predict.Anything
// Deprecated: See [predict.Dirs]
PredictDirs = predict.Dirs
// Deprecated: See [predict.Files]
PredictFiles = predict.Files
// Deprecated: See [predict.Set]
PredictSet = predict.Set
)
type (
// Deprecated: See [predict.Predictor]
Predictor = predict.Predictor
// Deprecated: See [predict.Func]
PredictFunc = oldFunc
// Deprecated: See [args.Parser]
Parser = args.Parser
// Deprecated: see [args.Args]
Args = args.Args
// Alias to [command.Command] for import ergonomics
Command = command.Command
// Alias to [command.Commands] for import ergonomics
Commands = command.Commands
// Alias to [command.Flags] for import ergonomics
Flags = command.Flags
)
// Compatibility with posener/complete v1
//
// We've changed this for better godoc ordering in pkgsite
type oldFunc func(args.Args) []string
// Predict invokes the predict function and implements the Predictor interface
func (f oldFunc) Predict(a args.Args) []string {
if f == nil {
return nil
}
return f(a)
}
var _ predict.Predictor = (oldFunc)(nil)