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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
- feat(service/vcl): moved the `vcl` command under the `service` command, with an unlisted and deprecated alias of `vcl` ([#1616](https://github.com/fastly/cli/pull/1616))
- feat(service/healthcheck): moved the `healthcheck` command under the `service` command, with an unlisted and deprecated alias of `healthcheck` ([#1619](https://github.com/fastly/cli/pull/1619))
- feat(service/backend): moved the `backend` command under the `service` command, with an unlisted and deprecated alias of `backend` ([#1621](https://github.com/fastly/cli/pull/1621))
- feat(service/backend): moved the `acl` and `aclentry` commands under the `service` command, with a unlisted and deprecated aliases of `acl` and `aclentry` ([#1621](https://github.com/fastly/cli/pull/1624))
- feat(service/acl): moved the `acl` and `aclentry` commands under the `service` command, with a unlisted and deprecated aliases of `acl` and `aclentry` ([#1621](https://github.com/fastly/cli/pull/1624))
- feat(version): If the latest version is at least one major version higher than the current version, provide links to the release notes for the major version(s) so the user can review them before upgrading. ([#1623](https://github.com/fastly/cli/pull/1623))
- feat(service/imageoptimizerdefaults): moved the `imageoptimizerdefaults` commands under the `service` command, with an unlisted and deprecated alias of `imageoptimizerdefaults` ([#1627](https://github.com/fastly/cli/pull/1627))
- feat(service/alert): moved the `alerts` command to the `service alert` command, with an unlisted and deprecated alias of `alerts` ([#1616](https://github.com/fastly/cli/pull/1626))
- feat(service/dictionaryentry): moved the `dictionary-entry` commands under the `service` command, with an unlisted and deprecated alias of `dictionary-entry` ([#1628](https://github.com/fastly/cli/pull/1628))

### Bug fixes:

Expand Down
1 change: 0 additions & 1 deletion pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ config-store
config-store-entry
dashboard
dictionary
dictionary-entry
domain
install
ip-list
Expand Down
29 changes: 29 additions & 0 deletions pkg/commands/alias/dictionaryentry/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dictionaryentry

import (
"io"

servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// CreateCommand wraps the CreateCommand from the servicedictionaryentry package.
type CreateCommand struct {
*servicedictionaryentry.CreateCommand
}

// NewCreateCommand returns a usable command registered under the parent.
func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateCommand {
c := CreateCommand{servicedictionaryentry.NewCreateCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *CreateCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service dictionary-entry create' command instead.")
return c.CreateCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/dictionaryentry/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dictionaryentry

import (
"io"

servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// DeleteCommand wraps the DeleteCommand from the servicedictionaryentry package.
type DeleteCommand struct {
*servicedictionaryentry.DeleteCommand
}

// NewDeleteCommand returns a usable command registered under the parent.
func NewDeleteCommand(parent argparser.Registerer, g *global.Data) *DeleteCommand {
c := DeleteCommand{servicedictionaryentry.NewDeleteCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *DeleteCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service dictionary-entry delete' command instead.")
return c.DeleteCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/dictionaryentry/describe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dictionaryentry

import (
"io"

servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// DescribeCommand wraps the DescribeCommand from the servicedictionaryentry package.
type DescribeCommand struct {
*servicedictionaryentry.DescribeCommand
}

// NewDescribeCommand returns a usable command registered under the parent.
func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCommand {
c := DescribeCommand{servicedictionaryentry.NewDescribeCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *DescribeCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service dictionary-entry describe' command instead.")
return c.DescribeCommand.Exec(in, out)
}
2 changes: 2 additions & 0 deletions pkg/commands/alias/dictionaryentry/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package dictionaryentry contains the 'dictionary-entry' alias for the 'service dictionary-entry' command.
package dictionaryentry
29 changes: 29 additions & 0 deletions pkg/commands/alias/dictionaryentry/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dictionaryentry

import (
"io"

servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// ListCommand wraps the ListCommand from the servicedictionaryentry package.
type ListCommand struct {
*servicedictionaryentry.ListCommand
}

// NewListCommand returns a usable command registered under the parent.
func NewListCommand(parent argparser.Registerer, g *global.Data) *ListCommand {
c := ListCommand{servicedictionaryentry.NewListCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *ListCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service dictionary-entry list' command instead.")
return c.ListCommand.Exec(in, out)
}
31 changes: 31 additions & 0 deletions pkg/commands/alias/dictionaryentry/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package dictionaryentry

import (
"io"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
)

// RootCommand is the parent command for all subcommands in this package.
// It should be installed under the primary root command.
type RootCommand struct {
argparser.Base
// no flags
}

// CommandName is the string to be used to invoke this command.
const CommandName = "dictionary-entry"

// NewRootCommand returns a new command registered in the parent.
func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
var c RootCommand
c.Globals = g
c.CmdClause = parent.Command(CommandName, "Manipulate Fastly edge dictionary items").Hidden()
return &c
}

// Exec implements the command interface.
func (c *RootCommand) Exec(_ io.Reader, _ io.Writer) error {
panic("unreachable")
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/dictionaryentry/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dictionaryentry

import (
"io"

servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"

"github.com/fastly/cli/pkg/argparser"
"github.com/fastly/cli/pkg/global"
"github.com/fastly/cli/pkg/text"
)

// UpdateCommand wraps the UpdateCommand from the servicedictionaryentry package.
type UpdateCommand struct {
*servicedictionaryentry.UpdateCommand
}

// NewUpdateCommand returns a usable command registered under the parent.
func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateCommand {
c := UpdateCommand{servicedictionaryentry.NewUpdateCommand(parent, g)}
c.CmdClause.Hidden()
return &c
}

// Exec implements the command interface.
func (c *UpdateCommand) Exec(in io.Reader, out io.Writer) error {
text.Deprecated(out, "Use the 'service dictionary-entry update' command instead.")
return c.UpdateCommand.Exec(in, out)
}
38 changes: 25 additions & 13 deletions pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
aliasaclentry "github.com/fastly/cli/pkg/commands/alias/aclentry"
aliasalerts "github.com/fastly/cli/pkg/commands/alias/alerts"
aliasbackend "github.com/fastly/cli/pkg/commands/alias/backend"
aliasdictionaryentry "github.com/fastly/cli/pkg/commands/alias/dictionaryentry"
aliashealthcheck "github.com/fastly/cli/pkg/commands/alias/healthcheck"
aliasimageoptimizerdefaults "github.com/fastly/cli/pkg/commands/alias/imageoptimizerdefaults"
aliaspurge "github.com/fastly/cli/pkg/commands/alias/purge"
Expand All @@ -25,7 +26,6 @@ import (
"github.com/fastly/cli/pkg/commands/dashboard"
dashboardItem "github.com/fastly/cli/pkg/commands/dashboard/item"
"github.com/fastly/cli/pkg/commands/dictionary"
"github.com/fastly/cli/pkg/commands/dictionaryentry"
"github.com/fastly/cli/pkg/commands/domain"
"github.com/fastly/cli/pkg/commands/install"
"github.com/fastly/cli/pkg/commands/ip"
Expand Down Expand Up @@ -102,6 +102,7 @@ import (
serviceaclentry "github.com/fastly/cli/pkg/commands/service/aclentry"
servicealert "github.com/fastly/cli/pkg/commands/service/alert"
servicebackend "github.com/fastly/cli/pkg/commands/service/backend"
servicedictionaryentry "github.com/fastly/cli/pkg/commands/service/dictionaryentry"
servicedomain "github.com/fastly/cli/pkg/commands/service/domain"
servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"
serviceimageoptimizerdefaults "github.com/fastly/cli/pkg/commands/service/imageoptimizerdefaults"
Expand Down Expand Up @@ -200,12 +201,6 @@ func Define( // nolint:revive // function-length
dictionaryCreate := dictionary.NewCreateCommand(dictionaryCmdRoot.CmdClause, data)
dictionaryDelete := dictionary.NewDeleteCommand(dictionaryCmdRoot.CmdClause, data)
dictionaryDescribe := dictionary.NewDescribeCommand(dictionaryCmdRoot.CmdClause, data)
dictionaryEntryCmdRoot := dictionaryentry.NewRootCommand(app, data)
dictionaryEntryCreate := dictionaryentry.NewCreateCommand(dictionaryEntryCmdRoot.CmdClause, data)
dictionaryEntryDelete := dictionaryentry.NewDeleteCommand(dictionaryEntryCmdRoot.CmdClause, data)
dictionaryEntryDescribe := dictionaryentry.NewDescribeCommand(dictionaryEntryCmdRoot.CmdClause, data)
dictionaryEntryList := dictionaryentry.NewListCommand(dictionaryEntryCmdRoot.CmdClause, data)
dictionaryEntryUpdate := dictionaryentry.NewUpdateCommand(dictionaryEntryCmdRoot.CmdClause, data)
dictionaryList := dictionary.NewListCommand(dictionaryCmdRoot.CmdClause, data)
dictionaryUpdate := dictionary.NewUpdateCommand(dictionaryCmdRoot.CmdClause, data)
domainCmdRoot := domain.NewRootCommand(app, data)
Expand Down Expand Up @@ -655,6 +650,12 @@ func Define( // nolint:revive // function-length
servicedomainList := servicedomain.NewListCommand(servicedomainCmdRoot.CmdClause, data)
servicedomainUpdate := servicedomain.NewUpdateCommand(servicedomainCmdRoot.CmdClause, data)
servicedomainValidate := servicedomain.NewValidateCommand(servicedomainCmdRoot.CmdClause, data)
servicedictionaryentryCmdRoot := servicedictionaryentry.NewRootCommand(serviceCmdRoot.CmdClause, data)
servicedictionaryentryCreate := servicedictionaryentry.NewCreateCommand(servicedictionaryentryCmdRoot.CmdClause, data)
servicedictionaryentryDelete := servicedictionaryentry.NewDeleteCommand(servicedictionaryentryCmdRoot.CmdClause, data)
servicedictionaryentryDescribe := servicedictionaryentry.NewDescribeCommand(servicedictionaryentryCmdRoot.CmdClause, data)
servicedictionaryentryList := servicedictionaryentry.NewListCommand(servicedictionaryentryCmdRoot.CmdClause, data)
servicedictionaryentryUpdate := servicedictionaryentry.NewUpdateCommand(servicedictionaryentryCmdRoot.CmdClause, data)
servicebackendCmdRoot := servicebackend.NewRootCommand(serviceCmdRoot.CmdClause, data)
servicebackendCreate := servicebackend.NewCreateCommand(servicebackendCmdRoot.CmdClause, data)
servicebackendDelete := servicebackend.NewDeleteCommand(servicebackendCmdRoot.CmdClause, data)
Expand Down Expand Up @@ -731,6 +732,12 @@ func Define( // nolint:revive // function-length
aliasBackendDescribe := aliasbackend.NewDescribeCommand(aliasBackendRoot.CmdClause, data)
aliasBackendList := aliasbackend.NewListCommand(aliasBackendRoot.CmdClause, data)
aliasBackendUpdate := aliasbackend.NewUpdateCommand(aliasBackendRoot.CmdClause, data)
aliasDictionaryEntryRoot := aliasdictionaryentry.NewRootCommand(app, data)
aliasDictionaryEntryCreate := aliasdictionaryentry.NewCreateCommand(aliasDictionaryEntryRoot.CmdClause, data)
aliasDictionaryEntryDelete := aliasdictionaryentry.NewDeleteCommand(aliasDictionaryEntryRoot.CmdClause, data)
aliasDictionaryEntryDescribe := aliasdictionaryentry.NewDescribeCommand(aliasDictionaryEntryRoot.CmdClause, data)
aliasDictionaryEntryList := aliasdictionaryentry.NewListCommand(aliasDictionaryEntryRoot.CmdClause, data)
aliasDictionaryEntryUpdate := aliasdictionaryentry.NewUpdateCommand(aliasDictionaryEntryRoot.CmdClause, data)
aliasHealthcheckRoot := aliashealthcheck.NewRootCommand(app, data)
aliasHealthcheckCreate := aliashealthcheck.NewCreateCommand(aliasHealthcheckRoot.CmdClause, data)
aliasHealthcheckDelete := aliashealthcheck.NewDeleteCommand(aliasHealthcheckRoot.CmdClause, data)
Expand Down Expand Up @@ -845,12 +852,6 @@ func Define( // nolint:revive // function-length
dictionaryCreate,
dictionaryDelete,
dictionaryDescribe,
dictionaryEntryCmdRoot,
dictionaryEntryCreate,
dictionaryEntryDelete,
dictionaryEntryDescribe,
dictionaryEntryList,
dictionaryEntryUpdate,
dictionaryList,
dictionaryUpdate,
domainCmdRoot,
Expand Down Expand Up @@ -1284,6 +1285,12 @@ func Define( // nolint:revive // function-length
servicedomainList,
servicedomainUpdate,
servicedomainValidate,
servicedictionaryentryCmdRoot,
servicedictionaryentryCreate,
servicedictionaryentryDelete,
servicedictionaryentryDescribe,
servicedictionaryentryList,
servicedictionaryentryUpdate,
servicebackendCmdRoot,
servicebackendCreate,
servicebackendDelete,
Expand Down Expand Up @@ -1367,6 +1374,11 @@ func Define( // nolint:revive // function-length
aliasBackendDescribe,
aliasBackendList,
aliasBackendUpdate,
aliasDictionaryEntryCreate,
aliasDictionaryEntryDelete,
aliasDictionaryEntryDescribe,
aliasDictionaryEntryList,
aliasDictionaryEntryUpdate,
aliasHealthcheckCreate,
aliasHealthcheckDelete,
aliasHealthcheckDescribe,
Expand Down
Loading