Skip to content

Commit

Permalink
feat: add hlp config env flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yiblet committed May 9, 2024
1 parent 441ed0b commit 9bf8f5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"

"github.com/PullRequestInc/go-gpt3"
"github.com/kirsle/configdir"
Expand Down Expand Up @@ -77,6 +78,7 @@ func (c *config) Write() error {
}

func ReadConfig(fileName string) (config, error) {
fileName = strings.TrimSpace(fileName)
if fileName == "" {
fileName = defaultConfigFilename
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type mainCmd struct {
Ask *askCmd `arg:"subcommand"`
Config *configCmd `arg:"subcommand"`
Chat *chatCmd `arg:"subcommand"`
ConfigName string `arg:"-c,--config" help:"name of the configuration set"`
ConfigName string `arg:"-c,--config,env:HLP_CONFIG" help:"name of the configuration set"`
}

func (args *mainCmd) SetupConfig() (config, error) {
Expand Down

0 comments on commit 9bf8f5b

Please sign in to comment.