diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-04 01:36:33 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-01-04 01:36:33 +0900 |
commit | baad26a0fd0d39640ec31f98d92a8745b022f755 (patch) | |
tree | 321e52b40fd73e0fbfde2c42b2db4c8b1d743311 /src/core.go | |
parent | f3177305d5572b26f135fc045481358b4eb1bf69 (diff) |
Fix exit conditions of --select-1 and --exit-0
Diffstat (limited to 'src/core.go')
-rw-r--r-- | src/core.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core.go b/src/core.go index 2601397a..4cdf79ad 100644 --- a/src/core.go +++ b/src/core.go @@ -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) } |