Skip to content
Open
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module github.com/dnsimple/dnsimple-cli
go 1.25.4

require (
github.com/dnsimple/dnsimple-go/v8 v8.2.0
github.com/dnsimple/dnsimple-go/v9 v9.1.0
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
golang.org/x/term v0.41.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -28,6 +29,5 @@ require (
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.28.0 // indirect
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dnsimple/dnsimple-go/v8 v8.2.0 h1:nNgtqKrt1K1BIWIpKTCL2qCiQcfYUxzsyRGIKLYEYH0=
github.com/dnsimple/dnsimple-go/v8 v8.2.0/go.mod h1:61MdYHRL+p2TBBUVEkxo1n4iRF6s3R9fZcvQvyt5du8=
github.com/dnsimple/dnsimple-go/v9 v9.1.0 h1:y9ZacZk+fv3cUWDPVh8mdgvwin9DwQl8aQFBHWytC9E=
github.com/dnsimple/dnsimple-go/v9 v9.1.0/go.mod h1:OcXRl+Ozh0ukD9Et8/IbfZv1ny4CpiUrHYk//yXR2q0=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
Expand Down Expand Up @@ -51,8 +51,6 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/dnsimple/dnsimple-cli/internal/client"
"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
"golang.org/x/term"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/confirm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/contacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/pagination"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion internal/cli/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/pagination"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -64,6 +64,7 @@ func (d *domainItem) TableRows() [][]string {
{"State", dom.State},
{"Auto Renew", strconv.FormatBool(dom.AutoRenew)},
{"Private WHOIS", strconv.FormatBool(dom.PrivateWhois)},
{"Trustee", strconv.FormatBool(dom.Trustee)},
{"Expires At", dom.ExpiresAt},
{"Created At", dom.CreatedAt},
{"Updated At", dom.UpdatedAt},
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/domains_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/domains_dnssec.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/domains_ds_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/domains_email_forwards.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/domains_pushes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
internalclient "github.com/dnsimple/dnsimple-cli/internal/client"
"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/stretchr/testify/assert"
)

Expand Down
19 changes: 15 additions & 4 deletions internal/cli/registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -38,16 +38,21 @@ type domainPriceOutput struct {
}

func (d *domainPriceOutput) TableHeaders() []string {
return []string{"DOMAIN", "PREMIUM", "REGISTRATION", "RENEWAL", "TRANSFER"}
return []string{"DOMAIN", "PREMIUM", "REGISTRATION", "RENEWAL", "TRANSFER", "TRUSTEE"}
}

func (d *domainPriceOutput) TableRows() [][]string {
trustee := "-"
if d.Data.TrusteePrice != nil {
trustee = fmt.Sprintf("%.2f", *d.Data.TrusteePrice)
}
return [][]string{{
d.Data.Domain,
strconv.FormatBool(d.Data.Premium),
fmt.Sprintf("%.2f", d.Data.RegistrationPrice),
fmt.Sprintf("%.2f", d.Data.RenewalPrice),
fmt.Sprintf("%.2f", d.Data.TransferPrice),
trustee,
}}
}

Expand All @@ -73,6 +78,7 @@ func (d *domainRegistrationOutput) TableRows() [][]string {
{"State", r.State},
{"Auto Renew", strconv.FormatBool(r.AutoRenew)},
{"WHOIS Privacy", strconv.FormatBool(r.WhoisPrivacy)},
{"Trustee", strconv.FormatBool(r.Trustee)},
{"Period", strconv.Itoa(r.Period)},
}
}
Expand Down Expand Up @@ -122,6 +128,7 @@ func (d *domainTransferOutput) TableRows() [][]string {
{"State", t.State},
{"Auto Renew", strconv.FormatBool(t.AutoRenew)},
{"WHOIS Privacy", strconv.FormatBool(t.WhoisPrivacy)},
{"Trustee", strconv.FormatBool(t.Trustee)},
}
}

Expand Down Expand Up @@ -205,7 +212,7 @@ func newRegistrarPricesCmd(f *cmdutil.Factory) *cobra.Command {

func newRegistrarRegisterCmd(f *cmdutil.Factory) *cobra.Command {
var registrantID int
var autoRenew, whoisPrivacy bool
var autoRenew, whoisPrivacy, trusteeService bool
var premiumPrice string
var extendedAttributes []string

Expand All @@ -228,6 +235,7 @@ func newRegistrarRegisterCmd(f *cmdutil.Factory) *cobra.Command {
RegistrantID: registrantID,
EnableAutoRenewal: autoRenew,
EnableWhoisPrivacy: whoisPrivacy,
Trustee: &trusteeService,
PremiumPrice: premiumPrice,
ExtendedAttributes: parseExtendedAttributes(extendedAttributes),
}
Expand All @@ -244,6 +252,7 @@ func newRegistrarRegisterCmd(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().IntVar(&registrantID, "registrant-id", 0, "Contact ID to use as registrant")
cmd.Flags().BoolVar(&autoRenew, "auto-renew", true, "Enable auto-renewal")
cmd.Flags().BoolVar(&whoisPrivacy, "whois-privacy", false, "Enable WHOIS privacy")
cmd.Flags().BoolVar(&trusteeService, "trustee", false, "Enable trustee service (extra cost may apply)")
cmd.Flags().StringVar(&premiumPrice, "premium-price", "", "Confirm premium price")
cmd.Flags().StringArrayVar(&extendedAttributes, "extended-attribute", nil, "Extended attributes (key=value)")
_ = cmd.MarkFlagRequired("registrant-id")
Expand All @@ -254,7 +263,7 @@ func newRegistrarRegisterCmd(f *cmdutil.Factory) *cobra.Command {
func newRegistrarTransferCmd(f *cmdutil.Factory) *cobra.Command {
var registrantID int
var authCode string
var autoRenew, whoisPrivacy bool
var autoRenew, whoisPrivacy, trusteeService bool
var premiumPrice string
var extendedAttributes []string

Expand All @@ -278,6 +287,7 @@ func newRegistrarTransferCmd(f *cmdutil.Factory) *cobra.Command {
AuthCode: authCode,
EnableAutoRenewal: autoRenew,
EnableWhoisPrivacy: whoisPrivacy,
Trustee: &trusteeService,
PremiumPrice: premiumPrice,
ExtendedAttributes: parseExtendedAttributes(extendedAttributes),
}
Expand All @@ -295,6 +305,7 @@ func newRegistrarTransferCmd(f *cmdutil.Factory) *cobra.Command {
cmd.Flags().StringVar(&authCode, "auth-code", "", "Authorization code from current registrar")
cmd.Flags().BoolVar(&autoRenew, "auto-renew", true, "Enable auto-renewal")
cmd.Flags().BoolVar(&whoisPrivacy, "whois-privacy", false, "Enable WHOIS privacy")
cmd.Flags().BoolVar(&trusteeService, "trustee", false, "Enable trustee service (extra cost may apply)")
cmd.Flags().StringVar(&premiumPrice, "premium-price", "", "Confirm premium price")
cmd.Flags().StringArrayVar(&extendedAttributes, "extended-attribute", nil, "Extended attributes (key=value)")
_ = cmd.MarkFlagRequired("registrant-id")
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/registrar_delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/registrar_registrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/registrar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-cli/internal/config"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/registrar_transfer_lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/templates_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/dnsimple/dnsimple-cli/internal/cmdutil"
"github.com/dnsimple/dnsimple-go/v8/dnsimple"
"github.com/dnsimple/dnsimple-go/v9/dnsimple"
"github.com/spf13/cobra"
)

Expand Down
Loading