077ec96d94
Change-Id: I820cf6444a3ddccee0d7c647dc84c80b2752068c
28 lines
828 B
Go
28 lines
828 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/common/rpc/quic" // This enables quic connector
|
|
"storj.io/private/process"
|
|
"storj.io/storj/cmd/uplink/cmd"
|
|
_ "storj.io/storj/private/version" // This attaches version information during release builds.
|
|
)
|
|
|
|
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
|
|
})
|
|
}
|