mirror of
https://github.com/gregtwallace/apc-p15-tool.git
synced 2025-06-08 04:46:52 +00:00
add install only version
This commit is contained in:
parent
a089d12c87
commit
d6bb512b3e
4 changed files with 26 additions and 9 deletions
pkg/app
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue