@ -147,6 +147,7 @@ Usage: fzf [options]
-- walker - root = DIR Root directory from which to start walker ( default : . )
-- walker - root = DIR Root directory from which to start walker ( default : . )
-- walker - skip = DIRS Comma - separated list of directory names to skip
-- walker - skip = DIRS Comma - separated list of directory names to skip
( default : . git , node_modules )
( default : . git , node_modules )
-- walker - path - sep = CHAR Path separator to use ( default : / on Unix , \ on Windows )
Shell integration
Shell integration
-- bash Print script to set up Bash shell integration
-- bash Print script to set up Bash shell integration
@ -489,6 +490,7 @@ type Options struct {
WalkerOpts walkerOpts
WalkerOpts walkerOpts
WalkerRoot string
WalkerRoot string
WalkerSkip [ ] string
WalkerSkip [ ] string
WalkerSep byte
Version bool
Version bool
Help bool
Help bool
CPUProfile string
CPUProfile string
@ -592,6 +594,7 @@ func defaultOptions() *Options {
WalkerOpts : walkerOpts { file : true , hidden : true , follow : true } ,
WalkerOpts : walkerOpts { file : true , hidden : true , follow : true } ,
WalkerRoot : "." ,
WalkerRoot : "." ,
WalkerSkip : [ ] string { ".git" , "node_modules" } ,
WalkerSkip : [ ] string { ".git" , "node_modules" } ,
WalkerSep : os . PathSeparator ,
Help : false ,
Help : false ,
Version : false }
Version : false }
}
}
@ -1904,6 +1907,14 @@ func parseMarkerMultiLine(str string) (*[3]string, error) {
return & result , nil
return & result , nil
}
}
func parsePathSep ( str string ) ( byte , error ) {
bytes := [ ] byte ( str )
if len ( bytes ) != 1 {
return os . PathSeparator , errors . New ( "invalid path separator (expected: single-byte character)" )
}
return bytes [ 0 ] , nil
}
func parseOptions ( index * int , opts * Options , allArgs [ ] string ) error {
func parseOptions ( index * int , opts * Options , allArgs [ ] string ) error {
var err error
var err error
var historyMax int
var historyMax int
@ -2479,6 +2490,14 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
return err
return err
}
}
opts . WalkerSkip = filterNonEmpty ( strings . Split ( str , "," ) )
opts . WalkerSkip = filterNonEmpty ( strings . Split ( str , "," ) )
case "--walker-path-sep" :
str , err := nextString ( allArgs , & i , "path separator required" )
if err != nil {
return err
}
if opts . WalkerSep , err = parsePathSep ( str ) ; err != nil {
return err
}
case "--profile-cpu" :
case "--profile-cpu" :
if opts . CPUProfile , err = nextString ( allArgs , & i , "file path required: cpu" ) ; err != nil {
if opts . CPUProfile , err = nextString ( allArgs , & i , "file path required: cpu" ) ; err != nil {
return err
return err
@ -2666,6 +2685,10 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
opts . WalkerRoot = value
opts . WalkerRoot = value
} else if match , value := optString ( arg , "--walker-skip=" ) ; match {
} else if match , value := optString ( arg , "--walker-skip=" ) ; match {
opts . WalkerSkip = filterNonEmpty ( strings . Split ( value , "," ) )
opts . WalkerSkip = filterNonEmpty ( strings . Split ( value , "," ) )
} else if match , value := optString ( arg , "--walker-path-sep=" ) ; match {
if opts . WalkerSep , err = parsePathSep ( value ) ; err != nil {
return err
}
} else if match , value := optString ( arg , "--hscroll-off=" ) ; match {
} else if match , value := optString ( arg , "--hscroll-off=" ) ; match {
if opts . HscrollOff , err = atoi ( value ) ; err != nil {
if opts . HscrollOff , err = atoi ( value ) ; err != nil {
return err
return err