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

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)
}