remove an unused error, and move stuff around

This commit is contained in:
Daisuke Maki 2016-06-16 23:31:19 +09:00
parent 3f2be2c877
commit ad19096c23
2 changed files with 17 additions and 23 deletions

23
cli.go
View file

@ -1,23 +0,0 @@
package peco
import "errors"
var ErrSignalReceived = errors.New("received signal")
// BufferSize returns the specified buffer size. Fulfills CtxOptions
func (o CLIOptions) BufferSize() int {
return o.OptBufferSize
}
// EnableNullSep returns true if --null was specified. Fulfills CtxOptions
func (o CLIOptions) EnableNullSep() bool {
return o.OptEnableNullSep
}
func (o CLIOptions) InitialIndex() int {
return o.OptInitialIndex
}
func (o CLIOptions) LayoutType() string {
return o.OptLayout
}

View file

@ -10,6 +10,23 @@ import (
"github.com/pkg/errors"
)
// BufferSize returns the specified buffer size. Fulfills CtxOptions
func (o CLIOptions) BufferSize() int {
return o.OptBufferSize
}
// EnableNullSep returns true if --null was specified. Fulfills CtxOptions
func (o CLIOptions) EnableNullSep() bool {
return o.OptEnableNullSep
}
func (o CLIOptions) InitialIndex() int {
return o.OptInitialIndex
}
func (o CLIOptions) LayoutType() string {
return o.OptLayout
}
func (options *CLIOptions) parse(s []string) ([]string, error) {
p := flags.NewParser(options, flags.PrintErrors)
args, err := p.ParseArgs(s)