|
|
|
@ -84,6 +84,7 @@ const usage = `usage: fzf [options]
|
|
|
|
|
[:[no]wrap][:[no]cycle][:[no]hidden]
|
|
|
|
|
[:rounded|sharp|noborder]
|
|
|
|
|
[:+SCROLL[-OFFSET]]
|
|
|
|
|
[:default]
|
|
|
|
|
|
|
|
|
|
Scripting
|
|
|
|
|
-q, --query=STR Start the finder with the given query
|
|
|
|
@ -226,6 +227,10 @@ type Options struct {
|
|
|
|
|
Version bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func defaultPreviewOpts(command string) previewOpts {
|
|
|
|
|
return previewOpts{command, posRight, sizeSpec{50, true}, "", false, false, false, tui.BorderRounded}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func defaultOptions() *Options {
|
|
|
|
|
return &Options{
|
|
|
|
|
Fuzzy: true,
|
|
|
|
@ -265,7 +270,7 @@ func defaultOptions() *Options {
|
|
|
|
|
ToggleSort: false,
|
|
|
|
|
Expect: make(map[int]string),
|
|
|
|
|
Keymap: make(map[int][]action),
|
|
|
|
|
Preview: previewOpts{"", posRight, sizeSpec{50, true}, "", false, false, false, tui.BorderRounded},
|
|
|
|
|
Preview: defaultPreviewOpts(""),
|
|
|
|
|
PrintQuery: false,
|
|
|
|
|
ReadZero: false,
|
|
|
|
|
Printer: func(str string) { fmt.Println(str) },
|
|
|
|
@ -1001,6 +1006,8 @@ func parsePreviewWindow(opts *previewOpts, input string) {
|
|
|
|
|
for _, token := range tokens {
|
|
|
|
|
switch token {
|
|
|
|
|
case "":
|
|
|
|
|
case "default":
|
|
|
|
|
*opts = defaultPreviewOpts(opts.command)
|
|
|
|
|
case "hidden":
|
|
|
|
|
opts.hidden = true
|
|
|
|
|
case "nohidden":
|
|
|
|
@ -1278,7 +1285,7 @@ func parseOptions(opts *Options, allArgs []string) {
|
|
|
|
|
opts.Preview.command = ""
|
|
|
|
|
case "--preview-window":
|
|
|
|
|
parsePreviewWindow(&opts.Preview,
|
|
|
|
|
nextString(allArgs, &i, "preview window layout required: [up|down|left|right][:SIZE[%]][:rounded|sharp|noborder][:wrap][:cycle][:hidden][:+SCROLL[-OFFSET]]"))
|
|
|
|
|
nextString(allArgs, &i, "preview window layout required: [up|down|left|right][:SIZE[%]][:rounded|sharp|noborder][:wrap][:cycle][:hidden][:+SCROLL[-OFFSET]][:default]"))
|
|
|
|
|
case "--height":
|
|
|
|
|
opts.Height = parseHeight(nextString(allArgs, &i, "height required: HEIGHT[%]"))
|
|
|
|
|
case "--min-height":
|
|
|
|
|