mirror of
https://github.com/onyx-and-iris/ignr.git
synced 2026-04-19 15:53:33 +00:00
add --start-search/-s flag
upd README
This commit is contained in:
@@ -2,13 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// filterFunc returns a function that filters templates based on the specified filter type.
|
||||
func filterFunc(templates []string) func(input string, index int) bool {
|
||||
switch viper.GetString("filter") {
|
||||
func filterFunc(templates []string, filterType string) func(input string, index int) bool {
|
||||
switch filterType {
|
||||
case "contains":
|
||||
return func(input string, index int) bool {
|
||||
return strings.Contains(strings.ToLower(templates[index]), strings.ToLower(input))
|
||||
|
||||
Reference in New Issue
Block a user