add install only version

This commit is contained in:
Greg T. Wallace 2024-02-02 18:35:21 -05:00
parent a089d12c87
commit d6bb512b3e
4 changed files with 26 additions and 9 deletions
pkg/app

View file

@ -2,7 +2,6 @@ package app
import (
"errors"
"os"
"github.com/peterbourgon/ff/v4"
)
@ -31,7 +30,7 @@ type config struct {
// getConfig returns the app's configuration from either command line args,
// or environment variables
func (app *app) getConfig() error {
func (app *app) getConfig(args []string) error {
// make config
cfg := &config{}
@ -93,7 +92,7 @@ func (app *app) getConfig() error {
// set cfg & parse
app.config = cfg
app.cmd = rootCmd
err := app.cmd.Parse(os.Args[1:], ff.WithEnvVarPrefix(environmentVarPrefix))
err := app.cmd.Parse(args[1:], ff.WithEnvVarPrefix(environmentVarPrefix))
if err != nil {
return err
}