f0aeda3091
* debug * traces * cfgstruct * process Package `storj/private/version` will be removed as a separate change. Change-Id: Iadc40faa782e6225513b28218952f02d9c240a9f
26 lines
671 B
Go
26 lines
671 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
|
|
"storj.io/private/process"
|
|
"storj.io/storj/cmd/uplink/cmd"
|
|
)
|
|
|
|
func main() {
|
|
process.ExecWithCustomConfig(cmd.RootCmd, true, func(cmd *cobra.Command, vip *viper.Viper) error {
|
|
accessFlag := cmd.Flags().Lookup("access")
|
|
// try to load configuration because we may still need 'accesses' (for named access)
|
|
// field but error only if 'access' flag is not set
|
|
err := process.LoadConfig(cmd, vip)
|
|
if err != nil && (accessFlag == nil || accessFlag.Value.String() == "") {
|
|
return err
|
|
}
|
|
return nil
|
|
})
|
|
}
|