add --start-search/-s flag

upd README
This commit is contained in:
2025-06-18 08:56:05 +01:00
parent e1875fb894
commit cf93198462
4 changed files with 27 additions and 13 deletions

View File

@@ -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))