replace huh with promptui

- it gives more control over filtering

add --filter/-f flag, this allows configuration over a prefix vs contains filter

update the README to reflect changes
This commit is contained in:
2025-06-18 03:31:34 +01:00
parent 39f762c0e6
commit 70b1c373ae
9 changed files with 254 additions and 117 deletions

View File

@@ -55,6 +55,8 @@ You may also list available templates and generate .gitignore files based on tho
func init() {
rootCmd.PersistentFlags().StringP("token", "t", "", "GitHub authentication token")
rootCmd.PersistentFlags().IntP("height", "H", 20, "Height of the selection prompt")
rootCmd.PersistentFlags().
StringP("filter", "f", "startswith", "Type of filter to apply to the list of templates (e.g., 'startswith', 'contains')")
rootCmd.Flags().BoolP("version", "v", false, "Print the version of the CLI")
@@ -62,6 +64,7 @@ func init() {
viper.AutomaticEnv()
viper.BindPFlag("token", rootCmd.PersistentFlags().Lookup("token"))
viper.BindPFlag("height", rootCmd.PersistentFlags().Lookup("height"))
viper.BindPFlag("filter", rootCmd.PersistentFlags().Lookup("filter"))
}
// main is the entry point of the application.