Skip to content

Commit

Permalink
add help text around env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Schmidt committed Jul 3, 2024
1 parent 7997745 commit f89d3cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
cd ~/work/asvec/asvec/bin/packages
COMMIT=$(git rev-parse --short HEAD)
VER=$(cat ../../VERSION.md)
RPM_VER=$(shell echo $(VER) | sed 's/-/_/g')
RPM_VER=$(echo ${VER} | sed 's/-/_/g')
BRANCH=$(git rev-parse --abbrev-ref HEAD)
TAG=${VER}-${COMMIT}
[ "${ADDCOMMIT}" = "false" ] && TAG=${VER}
Expand Down
12 changes: 6 additions & 6 deletions cmd/flags/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func NewClientFlags() *ClientFlags {

func (cf *ClientFlags) NewClientFlagSet() *pflag.FlagSet {
flagSet := &pflag.FlagSet{}
flagSet.VarP(cf.Host, Host, "h", commonFlags.DefaultWrapHelpString(fmt.Sprintf("The AVS host to connect to. If cluster discovery is needed use --%s", Seeds))) //nolint:lll // For readability
flagSet.Var(cf.Seeds, Seeds, commonFlags.DefaultWrapHelpString(fmt.Sprintf("The AVS seeds to use for cluster discovery. If no cluster discovery is needed (i.e. load-balancer) then use --%s", Host))) //nolint:lll // For readability
flagSet.VarP(&cf.ListenerName, ListenerName, "l", commonFlags.DefaultWrapHelpString("The listener to ask the AVS server for as configured in the AVS server. Likely required for cloud deployments.")) //nolint:lll // For readability
flagSet.VarP(&cf.User, AuthUser, "U", commonFlags.DefaultWrapHelpString("The AVS user to authenticate with.")) //nolint:lll // For readability
flagSet.VarP(&cf.Password, AuthPassword, "P", commonFlags.DefaultWrapHelpString("The AVS password for the specified user.")) //nolint:lll // For readability
flagSet.DurationVar(&cf.Timeout, Timeout, time.Second*5, commonFlags.DefaultWrapHelpString("The timeout to use for each request to AVS")) //nolint:lll // For readability
flagSet.VarP(cf.Host, Host, "h", commonFlags.DefaultWrapHelpString(fmt.Sprintf("The AVS host to connect to. If cluster discovery is needed use --%s. Additionally can be set using the environment variable ASVEC_HOST.", Seeds))) //nolint:lll // For readability
flagSet.Var(cf.Seeds, Seeds, commonFlags.DefaultWrapHelpString(fmt.Sprintf("The AVS seeds to use for cluster discovery. If no cluster discovery is needed (i.e. load-balancer) then use --%s. Additionally can be set using the environment variable ASVEC_SEEDS.", Host))) //nolint:lll // For readability
flagSet.VarP(&cf.ListenerName, ListenerName, "l", commonFlags.DefaultWrapHelpString("The listener to ask the AVS server for as configured in the AVS server. Likely required for cloud deployments.")) //nolint:lll // For readability
flagSet.VarP(&cf.User, AuthUser, "U", commonFlags.DefaultWrapHelpString("The AVS user to authenticate with. Additionally can be set using the environment variable ASVEC_USER")) //nolint:lll // For readability
flagSet.VarP(&cf.Password, AuthPassword, "P", commonFlags.DefaultWrapHelpString("The AVS password for the specified user. By default the environment variable ASVEC_PASSWORD will be checked. Other environment variables can also be used as well as different formats (i.e. base64)")) //nolint:lll // For readability
flagSet.DurationVar(&cf.Timeout, Timeout, time.Second*5, commonFlags.DefaultWrapHelpString("The timeout to use for each request to AVS")) //nolint:lll // For readability
flagSet.AddFlagSet(cf.NewTLSFlagSet(commonFlags.DefaultWrapHelpString))

return flagSet
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ var rootFlags = &struct {
var rootCmd = &cobra.Command{
Use: "asvec",
Short: "Aerospike Vector Search CLI",
Long: `Welcome to the AVS Deployment Manager CLI Tool!
Long: fmt.Sprintf(`Welcome to the AVS Deployment Manager CLI Tool!
To start using this tool, please consult the detailed documentation available at https://aerospike.com/docs/vector.
Should you encounter any issues or have questions, feel free to report them by creating a GitHub issue.
Enterprise customers requiring support should contact Aerospike Support directly at https://aerospike.com/support.
For example:
%s
asvec --help
`,
`, HelpTxtSetupEnv),
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
if rootFlags.logLevel.NotSet() {
lvl.Set(slog.LevelError + 1) // disable all logging
Expand Down

0 comments on commit f89d3cf

Please sign in to comment.