Skip to content

Commit 234f477

Browse files
authored
Add flag to enable verbose output (#216)
* Add flag to enable verbose output
1 parent 5bb5409 commit 234f477

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func Execute(build build.BuildInfo) {
4949
rootCmd.PersistentFlags().StringSlice("property", []string{}, "property to output (used with several formats), can be repeated")
5050
rootCmd.PersistentFlags().StringArray("filter", []string{}, "filter for list commands, can be repeated, e.g. 'property=somevalue', 'property:gt=3', 'property=valu*'")
5151
rootCmd.PersistentFlags().Int("page", 0, "page to retrieve for paginated requests")
52+
rootCmd.PersistentFlags().BoolP("verbose", "v", false, "Enables verbose output")
5253

5354
cobra.OnInitialize(initConfig)
5455

@@ -101,7 +102,7 @@ func initConfig() {
101102
}
102103
}
103104

104-
if config.GetBool("api_debug") {
105+
if config.GetBool("api_debug") || rootCmd.Flags().Changed("verbose") {
105106
logging.SetLogger(&output.DebugLogger{})
106107
}
107108
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.0
55
toolchain go1.24.5
66

77
require (
8-
github.com/ans-group/sdk-go v1.25.0
8+
github.com/ans-group/sdk-go v1.25.1
99
github.com/blang/semver v3.5.1+incompatible
1010
github.com/golang/mock v1.6.0
1111
github.com/iancoleman/strcase v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/ans-group/go-durationstring v1.2.0 h1:UJIuQATkp0t1rBvZsHRwki33YHV9E+Ulro+3NbMB7MM=
22
github.com/ans-group/go-durationstring v1.2.0/go.mod h1:QGF9Mdpq9058QXaut8r55QWu6lcHX6i/GvF1PZVkV6o=
3-
github.com/ans-group/sdk-go v1.25.0 h1:aPQKSvLhnpdx8qwXAMz0YV9UX2hp4uD39g+44/S33RU=
4-
github.com/ans-group/sdk-go v1.25.0/go.mod h1:Dx34ZUbyHNniHAKsDy/vp8q8hQC5L51ub2sv9We7d8E=
3+
github.com/ans-group/sdk-go v1.25.1 h1:/SdnjofRu8Tg/yNjTh61DYINfRxoYJqv17cV9N0lJDg=
4+
github.com/ans-group/sdk-go v1.25.1/go.mod h1:Dx34ZUbyHNniHAKsDy/vp8q8hQC5L51ub2sv9We7d8E=
55
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
66
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
77
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=

0 commit comments

Comments
 (0)