diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-21 17:29:58 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-06-21 17:29:58 +0900 |
commit | 8270f7f0cadf14c76feaadfb4068ccdf599a25e8 (patch) | |
tree | f7aa46f20d4f8c772b308f4a6734a0886eb6cad6 | |
parent | 638a956a9e10c19d88448f19f18186674dc5877f (diff) |
Rename --null to --read0 and undocument the option
`--null` is ambiguous. For completeness' sake, we need both `--read0`
and `--print0`.
`--read0` only makes sense when the input contains multiline entries.
However, fzf currently cannot correctly display multiline entries,
I'm going to make `--read0` an undocumented feature.
-rwxr-xr-x | fzf | 4 | ||||
-rw-r--r-- | src/options.go | 5 | ||||
-rw-r--r-- | test/test_go.rb | 4 |
3 files changed, 7 insertions, 6 deletions
@@ -206,10 +206,10 @@ class FZF @expect = true when /^--expect=(.*)$/ @expect = true - when '--toggle-sort', '--tiebreak', '--color', '--bind', '--history', '--history-max' + when '--toggle-sort', '--tiebreak', '--color', '--bind', '--history', '--history-size' argv.shift when '--tac', '--no-tac', '--sync', '--no-sync', '--hscroll', '--no-hscroll', - '--inline-info', '--no-inline-info', '--null', /^--bind=(.*)$/, + '--inline-info', '--no-inline-info', '--read0', '--cycle', /^--bind=(.*)$/, /^--color=(.*)$/, /^--toggle-sort=(.*)$/, /^--tiebreak=(.*)$/, /^--history(-max)?=(.*)$/ # XXX else diff --git a/src/options.go b/src/options.go index 4fa7cc8f..55e0543c 100644 --- a/src/options.go +++ b/src/options.go @@ -50,7 +50,6 @@ const usage = `usage: fzf [options] -1, --select-1 Automatically select the only match -0, --exit-0 Exit immediately when there's no match -f, --filter=STR Filter mode. Do not start interactive finder. - --null Read null-byte separated strings from input --print-query Print query as the first line --expect=KEYS Comma-separated list of keys to complete fzf --sync Synchronous search for multi-staged filtering @@ -679,8 +678,10 @@ func parseOptions(opts *Options, allArgs []string) { opts.Exit0 = true case "+0", "--no-exit-0": opts.Exit0 = false - case "--null": + case "--read0": opts.ReadZero = true + case "--no-read0": + opts.ReadZero = false case "--print-query": opts.PrintQuery = true case "--no-print-query": diff --git a/test/test_go.rb b/test/test_go.rb index 92f5a9e1..7bef8e6c 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -518,10 +518,10 @@ class TestGoFZF < TestBase assert_equal data, `cat #{tempname} | #{FZF} -f .`.chomp end - def test_null + def test_read0 lines = `find .`.split($/) assert_equal lines.last, `find . | #{FZF} -e -f "^#{lines.last}$"`.chomp - assert_equal lines.last, `find . -print0 | #{FZF} --null -e -f "^#{lines.last}$"`.chomp + assert_equal lines.last, `find . -print0 | #{FZF} --read0 -e -f "^#{lines.last}$"`.chomp end def test_select_all_deselect_all_toggle_all |