diff --git a/cli.go b/cli.go deleted file mode 100644 index 78c6599..0000000 --- a/cli.go +++ /dev/null @@ -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 -} diff --git a/options.go b/options.go index a185ae3..c075b7b 100644 --- a/options.go +++ b/options.go @@ -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)