Switch to circleci.

This commit is contained in:
Alec Thomas
2018-05-19 20:04:51 +10:00
parent a9179cd8ec
commit aea859372c
4 changed files with 15 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/alecthomas/kong
steps:
- checkout
- run: go get -v -t -d ./...
- run: go test -v ./...
+1 -1
View File
@@ -1,4 +1,4 @@
# Kong is a command-line parser for Go
# Kong is a command-line parser for Go [![CircleCI](https://circleci.com/gh/alecthomas/kong.svg?style=svg&circle-token=477fecac758383bf281453187269b913130f17d2)](https://circleci.com/gh/alecthomas/kong)
It parses a command-line into a struct. eg.
+2
View File
@@ -8,6 +8,8 @@ import (
const defaultHelp = `{{- with .Application -}}
usage: {{.Name}}
{{.Help}}
{{- end -}}
`
+1
View File
@@ -109,6 +109,7 @@ func (k *Kong) applyNode(scan *Scanner, node *Node, flags []*Flag) (command []st
}
args = append(args, token.Value)
}
// Note: tokens must be pushed in reverse order.
for i := range args {
scan.PushTyped(args[len(args)-1-i], PositionalArgumentToken)
}