Fix exit conditions of --select-1 and --exit-0

This commit is contained in:
Junegunn Choi 2015-01-04 01:36:33 +09:00
parent f3177305d5
commit baad26a0fd
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ func Run(options *Options) {
chunks: chunkList.Snapshot(),
pattern: pattern}, limit)
if !cancelled && (filtering || opts.Exit0) {
if !cancelled && (filtering ||
opts.Exit0 && len(matches) == 0 || opts.Select1 && len(matches) == 1) {
if opts.PrintQuery {
fmt.Println(patternString)
}