|
|
@ -53,7 +53,7 @@ const usage = `usage: fzf [options]
|
|
|
|
height instead of using fullscreen
|
|
|
|
height instead of using fullscreen
|
|
|
|
--min-height=HEIGHT Minimum height when --height is given in percent
|
|
|
|
--min-height=HEIGHT Minimum height when --height is given in percent
|
|
|
|
(default: 10)
|
|
|
|
(default: 10)
|
|
|
|
--reverse Reverse orientation
|
|
|
|
--layout=LAYOUT Choose layout: [default|reverse|reverse-list]
|
|
|
|
--border Draw border above and below the finder
|
|
|
|
--border Draw border above and below the finder
|
|
|
|
--margin=MARGIN Screen margin (TRBL / TB,RL / T,RL,B / T,R,B,L)
|
|
|
|
--margin=MARGIN Screen margin (TRBL / TB,RL / T,RL,B / T,R,B,L)
|
|
|
|
--inline-info Display finder info inline with the query
|
|
|
|
--inline-info Display finder info inline with the query
|
|
|
@ -90,7 +90,8 @@ const usage = `usage: fzf [options]
|
|
|
|
|
|
|
|
|
|
|
|
Environment variables
|
|
|
|
Environment variables
|
|
|
|
FZF_DEFAULT_COMMAND Default command to use when input is tty
|
|
|
|
FZF_DEFAULT_COMMAND Default command to use when input is tty
|
|
|
|
FZF_DEFAULT_OPTS Default options (e.g. '--reverse --inline-info')
|
|
|
|
FZF_DEFAULT_OPTS Default options
|
|
|
|
|
|
|
|
(e.g. '--layout=reverse --inline-info')
|
|
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
@ -132,6 +133,14 @@ const (
|
|
|
|
posRight
|
|
|
|
posRight
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type layoutType int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
|
|
|
layoutDefault layoutType = iota
|
|
|
|
|
|
|
|
layoutReverse
|
|
|
|
|
|
|
|
layoutReverseList
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type previewOpts struct {
|
|
|
|
type previewOpts struct {
|
|
|
|
command string
|
|
|
|
command string
|
|
|
|
position windowPosition
|
|
|
|
position windowPosition
|
|
|
@ -161,7 +170,7 @@ type Options struct {
|
|
|
|
Bold bool
|
|
|
|
Bold bool
|
|
|
|
Height sizeSpec
|
|
|
|
Height sizeSpec
|
|
|
|
MinHeight int
|
|
|
|
MinHeight int
|
|
|
|
Reverse bool
|
|
|
|
Layout layoutType
|
|
|
|
Cycle bool
|
|
|
|
Cycle bool
|
|
|
|
Hscroll bool
|
|
|
|
Hscroll bool
|
|
|
|
HscrollOff int
|
|
|
|
HscrollOff int
|
|
|
@ -211,7 +220,7 @@ func defaultOptions() *Options {
|
|
|
|
Black: false,
|
|
|
|
Black: false,
|
|
|
|
Bold: true,
|
|
|
|
Bold: true,
|
|
|
|
MinHeight: 10,
|
|
|
|
MinHeight: 10,
|
|
|
|
Reverse: false,
|
|
|
|
Layout: layoutDefault,
|
|
|
|
Cycle: false,
|
|
|
|
Cycle: false,
|
|
|
|
Hscroll: true,
|
|
|
|
Hscroll: true,
|
|
|
|
HscrollOff: 10,
|
|
|
|
HscrollOff: 10,
|
|
|
@ -857,6 +866,20 @@ func parseHeight(str string) sizeSpec {
|
|
|
|
return size
|
|
|
|
return size
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func parseLayout(str string) layoutType {
|
|
|
|
|
|
|
|
switch str {
|
|
|
|
|
|
|
|
case "default":
|
|
|
|
|
|
|
|
return layoutDefault
|
|
|
|
|
|
|
|
case "reverse":
|
|
|
|
|
|
|
|
return layoutReverse
|
|
|
|
|
|
|
|
case "reverse-list":
|
|
|
|
|
|
|
|
return layoutReverseList
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
errorExit("invalid layout (expected: default / reverse / reverse-list)")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return layoutDefault
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func parsePreviewWindow(opts *previewOpts, input string) {
|
|
|
|
func parsePreviewWindow(opts *previewOpts, input string) {
|
|
|
|
// Default
|
|
|
|
// Default
|
|
|
|
opts.position = posRight
|
|
|
|
opts.position = posRight
|
|
|
@ -1037,10 +1060,13 @@ func parseOptions(opts *Options, allArgs []string) {
|
|
|
|
opts.Bold = true
|
|
|
|
opts.Bold = true
|
|
|
|
case "--no-bold":
|
|
|
|
case "--no-bold":
|
|
|
|
opts.Bold = false
|
|
|
|
opts.Bold = false
|
|
|
|
|
|
|
|
case "--layout":
|
|
|
|
|
|
|
|
opts.Layout = parseLayout(
|
|
|
|
|
|
|
|
nextString(allArgs, &i, "layout required (default / reverse / reverse-list)"))
|
|
|
|
case "--reverse":
|
|
|
|
case "--reverse":
|
|
|
|
opts.Reverse = true
|
|
|
|
opts.Layout = layoutReverse
|
|
|
|
case "--no-reverse":
|
|
|
|
case "--no-reverse":
|
|
|
|
opts.Reverse = false
|
|
|
|
opts.Layout = layoutDefault
|
|
|
|
case "--cycle":
|
|
|
|
case "--cycle":
|
|
|
|
opts.Cycle = true
|
|
|
|
opts.Cycle = true
|
|
|
|
case "--no-cycle":
|
|
|
|
case "--no-cycle":
|
|
|
@ -1156,6 +1182,8 @@ func parseOptions(opts *Options, allArgs []string) {
|
|
|
|
opts.Height = parseHeight(value)
|
|
|
|
opts.Height = parseHeight(value)
|
|
|
|
} else if match, value := optString(arg, "--min-height="); match {
|
|
|
|
} else if match, value := optString(arg, "--min-height="); match {
|
|
|
|
opts.MinHeight = atoi(value)
|
|
|
|
opts.MinHeight = atoi(value)
|
|
|
|
|
|
|
|
} else if match, value := optString(arg, "--layout="); match {
|
|
|
|
|
|
|
|
opts.Layout = parseLayout(value)
|
|
|
|
} else if match, value := optString(arg, "--toggle-sort="); match {
|
|
|
|
} else if match, value := optString(arg, "--toggle-sort="); match {
|
|
|
|
parseToggleSort(opts.Keymap, value)
|
|
|
|
parseToggleSort(opts.Keymap, value)
|
|
|
|
} else if match, value := optString(arg, "--expect="); match {
|
|
|
|
} else if match, value := optString(arg, "--expect="); match {
|
|
|
|