forked from TrueCloudLab/frostfs-node
[#1381] neofs-cli: Move JSON and verbose printing to a common package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
c57114def3
commit
71d823f192
7 changed files with 57 additions and 39 deletions
|
@ -133,7 +133,7 @@ func initConfig() {
|
|||
|
||||
// If a config file is found, read it in.
|
||||
if err := viper.ReadInConfig(); err == nil {
|
||||
printVerbose("Using config file: %s", viper.ConfigFileUsed())
|
||||
common.PrintVerbose("Using config file: %s", viper.ConfigFileUsed())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ func prepareBearerPrm(cmd *cobra.Command, prm bearerPrm) {
|
|||
|
||||
func getTTL() uint32 {
|
||||
ttl := viper.GetUint32(ttl)
|
||||
printVerbose("TTL: %d", ttl)
|
||||
common.PrintVerbose("TTL: %d", ttl)
|
||||
|
||||
return ttl
|
||||
}
|
||||
|
@ -196,12 +196,6 @@ func userFromString(id *user.ID, s string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func printVerbose(format string, a ...interface{}) {
|
||||
if viper.GetBool(commonflags.Verbose) {
|
||||
fmt.Printf(format+"\n", a...)
|
||||
}
|
||||
}
|
||||
|
||||
func parseXHeaders() []*session.XHeader {
|
||||
xs := make([]*session.XHeader, 0, len(xHeaders))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue