updated GHA
Update to v2 SDK updated dependencies
This commit is contained in:
2
vendor/github.com/posener/complete/.gitignore
generated
vendored
2
vendor/github.com/posener/complete/.gitignore
generated
vendored
@ -1,4 +1,2 @@
|
||||
.idea
|
||||
coverage.txt
|
||||
gocomplete/gocomplete
|
||||
example/self/self
|
||||
|
7
vendor/github.com/posener/complete/.travis.yml
generated
vendored
7
vendor/github.com/posener/complete/.travis.yml
generated
vendored
@ -1,16 +1,17 @@
|
||||
language: go
|
||||
sudo: false
|
||||
go:
|
||||
- 1.11
|
||||
- 1.10.x
|
||||
- 1.9
|
||||
- 1.8
|
||||
|
||||
before_install:
|
||||
- go get -u -t ./...
|
||||
- go get -u gopkg.in/alecthomas/gometalinter.v1
|
||||
- gometalinter.v1 --install
|
||||
|
||||
script:
|
||||
- GO111MODULE=on ./test.sh
|
||||
- gometalinter.v1 --config metalinter.json ./...
|
||||
- ./test.sh
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
9
vendor/github.com/posener/complete/args.go
generated
vendored
9
vendor/github.com/posener/complete/args.go
generated
vendored
@ -57,20 +57,11 @@ func newArgs(line string) Args {
|
||||
}
|
||||
}
|
||||
|
||||
// splitFields returns a list of fields from the given command line.
|
||||
// If the last character is space, it appends an empty field in the end
|
||||
// indicating that the field before it was completed.
|
||||
// If the last field is of the form "a=b", it splits it to two fields: "a", "b",
|
||||
// So it can be completed.
|
||||
func splitFields(line string) []string {
|
||||
parts := strings.Fields(line)
|
||||
|
||||
// Add empty field if the last field was completed.
|
||||
if len(line) > 0 && unicode.IsSpace(rune(line[len(line)-1])) {
|
||||
parts = append(parts, "")
|
||||
}
|
||||
|
||||
// Treat the last field if it is of the form "a=b"
|
||||
parts = splitLastEqual(parts)
|
||||
return parts
|
||||
}
|
||||
|
2
vendor/github.com/posener/complete/cmd/cmd.go
generated
vendored
2
vendor/github.com/posener/complete/cmd/cmd.go
generated
vendored
@ -103,7 +103,7 @@ func (f *CLI) AddFlags(flags *flag.FlagSet) {
|
||||
fmt.Sprintf("Uninstall completion for %s command", f.Name))
|
||||
}
|
||||
if flags.Lookup("y") == nil {
|
||||
flags.BoolVar(&f.yes, "y", false, "Don't prompt user for typing 'yes' when installing completion")
|
||||
flags.BoolVar(&f.yes, "y", false, "Don't prompt user for typing 'yes'")
|
||||
}
|
||||
}
|
||||
|
||||
|
18
vendor/github.com/posener/complete/cmd/install/fish.go
generated
vendored
18
vendor/github.com/posener/complete/cmd/install/fish.go
generated
vendored
@ -16,10 +16,7 @@ type fish struct {
|
||||
|
||||
func (f fish) Install(cmd, bin string) error {
|
||||
completionFile := filepath.Join(f.configDir, "completions", fmt.Sprintf("%s.fish", cmd))
|
||||
completeCmd, err := f.cmd(cmd, bin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
completeCmd := f.cmd(cmd, bin)
|
||||
if _, err := os.Stat(completionFile); err == nil {
|
||||
return fmt.Errorf("already installed at %s", completionFile)
|
||||
}
|
||||
@ -36,10 +33,10 @@ func (f fish) Uninstall(cmd, bin string) error {
|
||||
return os.Remove(completionFile)
|
||||
}
|
||||
|
||||
func (f fish) cmd(cmd, bin string) (string, error) {
|
||||
func (f fish) cmd(cmd, bin string) string {
|
||||
var buf bytes.Buffer
|
||||
params := struct{ Cmd, Bin string }{cmd, bin}
|
||||
tmpl := template.Must(template.New("cmd").Parse(`
|
||||
template.Must(template.New("cmd").Parse(`
|
||||
function __complete_{{.Cmd}}
|
||||
set -lx COMP_LINE (string join ' ' (commandline -o))
|
||||
test (commandline -ct) = ""
|
||||
@ -47,10 +44,7 @@ function __complete_{{.Cmd}}
|
||||
{{.Bin}}
|
||||
end
|
||||
complete -c {{.Cmd}} -a "(__complete_{{.Cmd}})"
|
||||
`))
|
||||
err := tmpl.Execute(&buf, params)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return buf.String(), nil
|
||||
`)).Execute(&buf, params)
|
||||
|
||||
return string(buf.Bytes())
|
||||
}
|
||||
|
2
vendor/github.com/posener/complete/cmd/install/install.go
generated
vendored
2
vendor/github.com/posener/complete/cmd/install/install.go
generated
vendored
@ -51,7 +51,7 @@ func Uninstall(cmd string) error {
|
||||
for _, i := range is {
|
||||
errI := i.Uninstall(cmd, bin)
|
||||
if errI != nil {
|
||||
err = multierror.Append(err, errI)
|
||||
multierror.Append(err, errI)
|
||||
}
|
||||
}
|
||||
|
||||
|
5
vendor/github.com/posener/complete/cmd/install/utils.go
generated
vendored
5
vendor/github.com/posener/complete/cmd/install/utils.go
generated
vendored
@ -115,10 +115,7 @@ func removeContentToTempFile(name, content string) (string, error) {
|
||||
if str == content {
|
||||
continue
|
||||
}
|
||||
_, err = wf.WriteString(str + "\n")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
wf.WriteString(str + "\n")
|
||||
prefix = prefix[:0]
|
||||
}
|
||||
return wf.Name(), nil
|
||||
|
30
vendor/github.com/posener/complete/complete.go
generated
vendored
30
vendor/github.com/posener/complete/complete.go
generated
vendored
@ -10,16 +10,14 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/posener/complete/cmd"
|
||||
"github.com/posener/complete/match"
|
||||
)
|
||||
|
||||
const (
|
||||
envLine = "COMP_LINE"
|
||||
envPoint = "COMP_POINT"
|
||||
envDebug = "COMP_DEBUG"
|
||||
envComplete = "COMP_LINE"
|
||||
envDebug = "COMP_DEBUG"
|
||||
)
|
||||
|
||||
// Complete structs define completion for a command with CLI options
|
||||
@ -57,18 +55,13 @@ func (c *Complete) Run() bool {
|
||||
// For installation: it assumes that flags were added and parsed before
|
||||
// it was called.
|
||||
func (c *Complete) Complete() bool {
|
||||
line, point, ok := getEnv()
|
||||
line, ok := getLine()
|
||||
if !ok {
|
||||
// make sure flags parsed,
|
||||
// in case they were not added in the main program
|
||||
return c.CLI.Run()
|
||||
}
|
||||
|
||||
if point >= 0 && point < len(line) {
|
||||
line = line[:point]
|
||||
}
|
||||
|
||||
Log("Completing phrase: %s", line)
|
||||
Log("Completing line: %s", line)
|
||||
a := newArgs(line)
|
||||
Log("Completing last field: %s", a.Last)
|
||||
options := c.Command.Predict(a)
|
||||
@ -86,19 +79,12 @@ func (c *Complete) Complete() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func getEnv() (line string, point int, ok bool) {
|
||||
line = os.Getenv(envLine)
|
||||
func getLine() (string, bool) {
|
||||
line := os.Getenv(envComplete)
|
||||
if line == "" {
|
||||
return
|
||||
return "", false
|
||||
}
|
||||
point, err := strconv.Atoi(os.Getenv(envPoint))
|
||||
if err != nil {
|
||||
// If failed parsing point for some reason, set it to point
|
||||
// on the end of the line.
|
||||
Log("Failed parsing point %s: %v", os.Getenv(envPoint), err)
|
||||
point = len(line)
|
||||
}
|
||||
return line, point, true
|
||||
return line, true
|
||||
}
|
||||
|
||||
func (c *Complete) output(options []string) {
|
||||
|
3
vendor/github.com/posener/complete/log.go
generated
vendored
3
vendor/github.com/posener/complete/log.go
generated
vendored
@ -1,6 +1,7 @@
|
||||
package complete
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
@ -14,7 +15,7 @@ import (
|
||||
var Log = getLogger()
|
||||
|
||||
func getLogger() func(format string, args ...interface{}) {
|
||||
var logfile = ioutil.Discard
|
||||
var logfile io.Writer = ioutil.Discard
|
||||
if os.Getenv(envDebug) != "" {
|
||||
logfile = os.Stderr
|
||||
}
|
||||
|
21
vendor/github.com/posener/complete/metalinter.json
generated
vendored
Normal file
21
vendor/github.com/posener/complete/metalinter.json
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"Vendor": true,
|
||||
"DisableAll": true,
|
||||
"Enable": [
|
||||
"gofmt",
|
||||
"goimports",
|
||||
"interfacer",
|
||||
"goconst",
|
||||
"misspell",
|
||||
"unconvert",
|
||||
"gosimple",
|
||||
"golint",
|
||||
"structcheck",
|
||||
"deadcode",
|
||||
"vet"
|
||||
],
|
||||
"Exclude": [
|
||||
"initTests is unused"
|
||||
],
|
||||
"Deadline": "2m"
|
||||
}
|
1
vendor/github.com/posener/complete/readme.md
generated
vendored
1
vendor/github.com/posener/complete/readme.md
generated
vendored
@ -4,7 +4,6 @@ A tool for bash writing bash completion in go, and bash completion for the go co
|
||||
|
||||
[](https://travis-ci.org/posener/complete)
|
||||
[](https://codecov.io/gh/posener/complete)
|
||||
[](https://golangci.com/r/github.com/posener/complete)
|
||||
[](http://godoc.org/github.com/posener/complete)
|
||||
[](https://goreportcard.com/report/github.com/posener/complete)
|
||||
|
||||
|
Reference in New Issue
Block a user