diff --git a/cmd/admin/organizations.go b/cmd/admin/organizations.go index 8e2759b..5404b73 100644 --- a/cmd/admin/organizations.go +++ b/cmd/admin/organizations.go @@ -13,7 +13,7 @@ package admin import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -33,7 +33,7 @@ func OrganizationsCmd(imsConfig *ims.Config) *cobra.Command { if err != nil { return fmt.Errorf("error in get admin organizations cmd: %w", err) } - fmt.Println(pretty.JSON(resp)) + fmt.Println(prettify.JSON(resp)) return nil }, } diff --git a/cmd/admin/profile.go b/cmd/admin/profile.go index 9db3bcb..9d4ca31 100644 --- a/cmd/admin/profile.go +++ b/cmd/admin/profile.go @@ -14,7 +14,7 @@ package admin import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ func ProfileCmd(imsConfig *ims.Config) *cobra.Command { if err != nil { return fmt.Errorf("error in get admin profile cmd: %w", err) } - fmt.Println(pretty.JSON(resp)) + fmt.Println(prettify.JSON(resp)) return nil }, } diff --git a/cmd/dcr.go b/cmd/dcr.go index 5bde725..3e1d69a 100644 --- a/cmd/dcr.go +++ b/cmd/dcr.go @@ -13,7 +13,7 @@ package cmd import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -44,7 +44,7 @@ func registerCmd(imsConfig *ims.Config) *cobra.Command { return fmt.Errorf("error during client registration: %w", err) } - fmt.Println(pretty.JSON(resp)) + fmt.Println(prettify.JSON(resp)) return nil }, } diff --git a/cmd/decode.go b/cmd/decode.go index 3ba559a..af3dbda 100644 --- a/cmd/decode.go +++ b/cmd/decode.go @@ -16,7 +16,7 @@ import ( "os" "time" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -36,7 +36,7 @@ func decodeCmd(imsConfig *ims.Config) *cobra.Command { } output := fmt.Sprintf(`{"header":%s,"payload":%s}`, decoded.Header, decoded.Payload) - fmt.Println(pretty.JSON(output)) + fmt.Println(prettify.JSON(output)) // When verbose, show human-readable token expiration on stderr // so it doesn't pollute the JSON output on stdout. diff --git a/cmd/organizations.go b/cmd/organizations.go index e60d66f..6730f5f 100644 --- a/cmd/organizations.go +++ b/cmd/organizations.go @@ -13,7 +13,7 @@ package cmd import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -33,7 +33,7 @@ func organizationsCmd(imsConfig *ims.Config) *cobra.Command { if err != nil { return fmt.Errorf("error in get organizations cmd: %w", err) } - fmt.Println(pretty.JSON(resp)) + fmt.Println(prettify.JSON(resp)) return nil }, } diff --git a/cmd/pretty/json.go b/cmd/prettify/json.go similarity index 91% rename from cmd/pretty/json.go rename to cmd/prettify/json.go index c6ccaa0..cd90623 100644 --- a/cmd/pretty/json.go +++ b/cmd/prettify/json.go @@ -8,8 +8,8 @@ // OF ANY KIND, either express or implied. See the License for the specific language // governing permissions and limitations under the License. -// Package pretty provides output formatting helpers for the CLI. -package pretty +// Package prettify provides output formatting helpers for the CLI. +package prettify import ( "bytes" diff --git a/cmd/pretty/json_test.go b/cmd/prettify/json_test.go similarity index 97% rename from cmd/pretty/json_test.go rename to cmd/prettify/json_test.go index e534798..0d36577 100644 --- a/cmd/pretty/json_test.go +++ b/cmd/prettify/json_test.go @@ -8,7 +8,7 @@ // OF ANY KIND, either express or implied. See the License for the specific language // governing permissions and limitations under the License. -package pretty +package prettify import ( "math/rand" @@ -74,7 +74,7 @@ func randomString(rng *rand.Rand, length int) string { // // For deeper exploration, use Go's built-in fuzz engine: // -// go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/pretty/ +// go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/prettify/ func TestFuzzJSON(t *testing.T) { t.Parallel() @@ -96,7 +96,7 @@ func TestFuzzJSON(t *testing.T) { } // FuzzJSON is a standard Go fuzz target for deeper exploration. -// Run manually: go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/pretty/ +// Run manually: go test -fuzz=FuzzJSON -fuzztime=60s ./cmd/prettify/ func FuzzJSON(f *testing.F) { f.Add(`{}`) f.Add(`[]`) diff --git a/cmd/pretty/testdata/already_indented.json b/cmd/prettify/testdata/already_indented.json similarity index 100% rename from cmd/pretty/testdata/already_indented.json rename to cmd/prettify/testdata/already_indented.json diff --git a/cmd/pretty/testdata/compact_array.json b/cmd/prettify/testdata/compact_array.json similarity index 100% rename from cmd/pretty/testdata/compact_array.json rename to cmd/prettify/testdata/compact_array.json diff --git a/cmd/pretty/testdata/compact_object.json b/cmd/prettify/testdata/compact_object.json similarity index 100% rename from cmd/pretty/testdata/compact_object.json rename to cmd/prettify/testdata/compact_object.json diff --git a/cmd/pretty/testdata/empty_array.json b/cmd/prettify/testdata/empty_array.json similarity index 100% rename from cmd/pretty/testdata/empty_array.json rename to cmd/prettify/testdata/empty_array.json diff --git a/cmd/pretty/testdata/empty_object.json b/cmd/prettify/testdata/empty_object.json similarity index 100% rename from cmd/pretty/testdata/empty_object.json rename to cmd/prettify/testdata/empty_object.json diff --git a/cmd/pretty/testdata/empty_string.txt b/cmd/prettify/testdata/empty_string.txt similarity index 100% rename from cmd/pretty/testdata/empty_string.txt rename to cmd/prettify/testdata/empty_string.txt diff --git a/cmd/pretty/testdata/nested_objects.json b/cmd/prettify/testdata/nested_objects.json similarity index 100% rename from cmd/pretty/testdata/nested_objects.json rename to cmd/prettify/testdata/nested_objects.json diff --git a/cmd/pretty/testdata/non_json.txt b/cmd/prettify/testdata/non_json.txt similarity index 100% rename from cmd/pretty/testdata/non_json.txt rename to cmd/prettify/testdata/non_json.txt diff --git a/cmd/pretty/testdata/null_and_bool.json b/cmd/prettify/testdata/null_and_bool.json similarity index 100% rename from cmd/pretty/testdata/null_and_bool.json rename to cmd/prettify/testdata/null_and_bool.json diff --git a/cmd/pretty/testdata/special_chars.json b/cmd/prettify/testdata/special_chars.json similarity index 100% rename from cmd/pretty/testdata/special_chars.json rename to cmd/prettify/testdata/special_chars.json diff --git a/cmd/pretty/testdata/unicode.json b/cmd/prettify/testdata/unicode.json similarity index 100% rename from cmd/pretty/testdata/unicode.json rename to cmd/prettify/testdata/unicode.json diff --git a/cmd/profile.go b/cmd/profile.go index 4ad9eec..8bb731c 100644 --- a/cmd/profile.go +++ b/cmd/profile.go @@ -13,7 +13,7 @@ package cmd import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ func profileCmd(imsConfig *ims.Config) *cobra.Command { if err != nil { return fmt.Errorf("error in get profile cmd: %w", err) } - fmt.Println(pretty.JSON(resp)) + fmt.Println(prettify.JSON(resp)) return nil }, } diff --git a/cmd/validate/validate.go b/cmd/validate/validate.go index 72f7947..564427c 100644 --- a/cmd/validate/validate.go +++ b/cmd/validate/validate.go @@ -14,7 +14,7 @@ package validate import ( "fmt" - "github.com/adobe/imscli/cmd/pretty" + "github.com/adobe/imscli/cmd/prettify" "github.com/adobe/imscli/ims" "github.com/spf13/cobra" ) @@ -43,7 +43,7 @@ func tokenCmd(imsConfig *ims.Config, def tokenDef) *cobra.Command { if !resp.Valid { return fmt.Errorf("invalid token: %v", resp.Info) } - fmt.Println(pretty.JSON(resp.Info)) + fmt.Println(prettify.JSON(resp.Info)) return nil }, }