Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/admin/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/dcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cmd/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/pretty/json.go → cmd/prettify/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions cmd/pretty/json_test.go → cmd/prettify/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Expand All @@ -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(`[]`)
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
},
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
},
}
Expand Down
Loading