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

@ -24,7 +24,7 @@ type app struct {
}
// actual application start
func Start() {
func Start(args []string) {
// make app w/ initial logger pre-config
initLogLevel := "debug"
app := &app{
@ -34,8 +34,13 @@ func Start() {
// log start
app.logger.Infof("apc-p15-tool v%s", appVersion)
// get os.Args if args unspecified in func
if args == nil {
args = os.Args
}
// get & parse config
err := app.getConfig()
err := app.getConfig(args)
// re-init logger with configured log level
app.logger = makeZapLogger(app.config.logLevel)
@ -66,9 +71,6 @@ func Start() {
os.Exit(exitCode)
}
// get config
app.getConfig()
// run it
exitCode := 0
err = app.cmd.Run(context.Background())