parent
4b35da6de1
commit
63e3a6f38a
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
|||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
*.so
|
*.so
|
||||||
|
bin/
|
||||||
|
|
||||||
# Folders
|
# Folders
|
||||||
pkg/
|
pkg/
|
||||||
|
32
.travis.yml
Normal file
32
.travis.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
sudo: false
|
||||||
|
language: go
|
||||||
|
|
||||||
|
go:
|
||||||
|
- "1.11.x"
|
||||||
|
- tip
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
- windows
|
||||||
|
|
||||||
|
install:
|
||||||
|
- make setup
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: Lint
|
||||||
|
script:
|
||||||
|
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "")
|
||||||
|
- make lint
|
||||||
|
go: "1.11.x"
|
||||||
|
os: osx
|
||||||
|
|
||||||
|
script:
|
||||||
|
- make test
|
||||||
|
- make build
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- go: tip
|
||||||
|
- os: windows
|
23
Makefile
23
Makefile
@ -2,33 +2,38 @@
|
|||||||
|
|
||||||
.PHONY: setup
|
.PHONY: setup
|
||||||
setup: ## Setup for required tools.
|
setup: ## Setup for required tools.
|
||||||
go get github.com/golang/lint/golint
|
go get -u golang.org/x/lint/golint
|
||||||
go get golang.org/x/tools/cmd/goimports
|
go get -u golang.org/x/tools/cmd/goimports
|
||||||
go get golang.org/x/tools/cmd/stringer
|
go get -u golang.org/x/tools/cmd/stringer
|
||||||
go get -u github.com/golang/dep/cmd/dep
|
go get -u github.com/golang/dep/cmd/dep
|
||||||
dep ensure
|
dep ensure
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: ## Formatting source codes.
|
fmt: ## Formatting source codes.
|
||||||
@goimports -w .
|
@goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*")
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: ## Run golint and go vet.
|
lint: ## Run golint and go vet.
|
||||||
@golint .
|
@golint .
|
||||||
|
@golint -set_exit_status=1
|
||||||
@go vet .
|
@go vet .
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: ## Run the tests.
|
test: ## Run the tests with race condition checking.
|
||||||
@go test .
|
@go test -race .
|
||||||
|
|
||||||
.PHONY: coverage
|
.PHONY: coverage
|
||||||
cover: ## Run the tests.
|
cover: ## Run the tests.
|
||||||
@go test -coverprofile=coverage.o
|
@go test -coverprofile=coverage.o
|
||||||
@go tool cover -func=coverage.o
|
@go tool cover -func=coverage.o
|
||||||
|
|
||||||
.PHONY: race-test
|
.PHONY: build
|
||||||
race-test: ## Checking the race condition.
|
build: ## Build example command lines.
|
||||||
@go test -race .
|
go build -o bin/exec-command ./_example/exec-command/main.go
|
||||||
|
go build -o bin/http-prompt ./_example/http-prompt/main.go
|
||||||
|
go build -o bin/live-prefix ./_example/live-prefix/main.go
|
||||||
|
go build -o bin/simple-echo ./_example/simple-echo/main.go
|
||||||
|
go build -o bin/simple-echo-cjk-cyrillic ./_example/simple-echo/cjk-cyrillic/main.go
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help: ## Show help text
|
help: ## Show help text
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)
|
![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)
|
||||||
[![Backers on Open Collective](https://opencollective.com/go-prompt/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/go-prompt/sponsors/badge.svg)](#sponsors)
|
[![Backers on Open Collective](https://opencollective.com/go-prompt/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/go-prompt/sponsors/badge.svg)](#sponsors)
|
||||||
[![GoDoc](https://godoc.org/github.com/c-bata/go-prompt?status.svg)](https://godoc.org/github.com/c-bata/go-prompt)
|
[![GoDoc](https://godoc.org/github.com/c-bata/go-prompt?status.svg)](https://godoc.org/github.com/c-bata/go-prompt)
|
||||||
|
[![Build Status](https://travis-ci.org/c-bata/go-prompt.svg?branch=master)](https://travis-ci.org/c-bata/go-prompt)
|
||||||
|
|
||||||
A library for building powerful interactive prompts inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit),
|
A library for building powerful interactive prompts inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit),
|
||||||
making it easier to build cross-platform command line tools using Go.
|
making it easier to build cross-platform command line tools using Go.
|
||||||
|
@ -43,6 +43,9 @@ func (w *PosixWriter) Flush() error {
|
|||||||
var _ ConsoleWriter = &PosixWriter{}
|
var _ ConsoleWriter = &PosixWriter{}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// NewStandardOutputWriter returns ConsoleWriter object to write to stdout.
|
||||||
|
// This generates VT100 escape sequences because almost terminal emulators
|
||||||
|
// in POSIX OS built on top of a VT100 specification.
|
||||||
// Deprecated: Please use NewStdoutWriter
|
// Deprecated: Please use NewStdoutWriter
|
||||||
NewStandardOutputWriter = NewStdoutWriter
|
NewStandardOutputWriter = NewStdoutWriter
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user