summaryrefslogtreecommitdiff
path: root/src/options.go
diff options
context:
space:
mode:
authorSimon Fraser <srfraser@users.noreply.github.com>2019-10-27 14:50:12 +0000
committerJunegunn Choi <junegunn.c@gmail.com>2019-10-27 23:50:12 +0900
commit391669a451c4eedd74dd6e1794601d2ca793340c (patch)
treef028d0e3dc22d1ea036807e330d60e5bf87389c2 /src/options.go
parent0c6c76e08115d0ba160e2c95c8692e4174aa5368 (diff)
downloadfzf-391669a451c4eedd74dd6e1794601d2ca793340c.tar.gz
Add 'f' flag for placeholder expression (#1733)
If present the contents of the selection will be placed in a temporary file, and the filename will be placed into the string instead.
Diffstat (limited to 'src/options.go')
-rw-r--r--src/options.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go
index 3449f3dc..bd2a038e 100644
--- a/src/options.go
+++ b/src/options.go
@@ -189,6 +189,7 @@ type Options struct {
PrintQuery bool
ReadZero bool
Printer func(string)
+ PrintSep string
Sync bool
History *History
Header []string
@@ -240,6 +241,7 @@ func defaultOptions() *Options {
PrintQuery: false,
ReadZero: false,
Printer: func(str string) { fmt.Println(str) },
+ PrintSep: "\n",
Sync: false,
History: nil,
Header: make([]string, 0),
@@ -1106,8 +1108,10 @@ func parseOptions(opts *Options, allArgs []string) {
opts.ReadZero = false
case "--print0":
opts.Printer = func(str string) { fmt.Print(str, "\x00") }
+ opts.PrintSep = "\x00"
case "--no-print0":
opts.Printer = func(str string) { fmt.Println(str) }
+ opts.PrintSep = "\n"
case "--print-query":
opts.PrintQuery = true
case "--no-print-query":