Skip to content

Commit

Permalink
Fix tab completion and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
zquestz committed Oct 2, 2022
1 parent 225484c commit c10fd83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ s is released under the MIT license.
[ReportCard-Image]: https://goreportcard.com/badge/github.com/zquestz/s
[Build-Status-URL]: http://travis-ci.com/zquestz/s
[Build-Status-Image]: https://travis-ci.com/zquestz/s.svg?branch=master
[Release-URL]: https://github.com/zquestz/s/releases/tag/v0.6.6
[Release-Image]: http://img.shields.io/badge/release-v0.6.6-1eb0fc.svg
[Release-URL]: https://github.com/zquestz/s/releases/tag/v0.6.7
[Release-Image]: http://img.shields.io/badge/release-v0.6.7-1eb0fc.svg
[Chat-Image]: https://badges.gitter.im/zquestz/s.svg
[Chat-URL]: https://gitter.im/zquestz/s?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
12 changes: 6 additions & 6 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

const (
appName = "s"
version = "0.6.6"
version = "0.6.7"
defaultPort = 8080
defaultProvider = "presearch"
)
Expand Down Expand Up @@ -134,6 +134,11 @@ func prepareFlags() {
SearchCmd.PersistentFlags().StringVarP(
&config.Key, "key", "k", config.Key, "path to key.pem for TLS")

config.Provider = strings.ToLower(config.Provider)

providers.SetBlacklist(config.Blacklist)
providers.SetWhitelist(config.Whitelist)

err := SearchCmd.RegisterFlagCompletionFunc("provider", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return providers.ProviderNames(config.Verbose), cobra.ShellCompDirectiveNoFileComp
})
Expand Down Expand Up @@ -168,11 +173,6 @@ func performCommand(cmd *cobra.Command, args []string) error {
return nil
}

config.Provider = strings.ToLower(config.Provider)

providers.SetBlacklist(config.Blacklist)
providers.SetWhitelist(config.Whitelist)

if config.ListProviders {
fmt.Print(providers.DisplayProviders(config.Verbose))
return nil
Expand Down

0 comments on commit c10fd83

Please sign in to comment.