Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- refactor(argparser/flags.go): add flag conversion utilities for converting string flags to bools and checking ascending and desecnding flags ([#1611](https://github.com/fastly/cli/pull/1611))
- feat(service/purge): Add 'service purge' command as replacement for 'purge', with an unlisted and deprecated alias of 'purge'. ([#1612](https://github.com/fastly/cli/pull/1612))
- feat(service/version): Add 'service version ...' commands as replacements for 'service-version ...', with unlisted and deprecated aliases of 'service-version ...'. ([#1614](https://github.com/fastly/cli/pull/1614))
- feat(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))

### 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 @@ -100,7 +100,6 @@ tls-subscription
tools
update
user
vcl
version
whoami
`,
Expand Down
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/condition/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package condition

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/condition"

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

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

// NewCreateCommand returns a usable command registered under the parent.
func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateCommand {
c := CreateCommand{newcmd.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 vcl condition create' command instead.")
return c.CreateCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/condition/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package condition

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/condition"

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

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

// NewDeleteCommand returns a usable command registered under the parent.
func NewDeleteCommand(parent argparser.Registerer, g *global.Data) *DeleteCommand {
c := DeleteCommand{newcmd.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 vcl condition delete' command instead.")
return c.DeleteCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/condition/describe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package condition

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/condition"

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

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

// NewDescribeCommand returns a usable command registered under the parent.
func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCommand {
c := DescribeCommand{newcmd.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 vcl condition describe' command instead.")
return c.DescribeCommand.Exec(in, out)
}
2 changes: 2 additions & 0 deletions pkg/commands/alias/vcl/condition/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package condition contains deprecated aliases for the 'service vcl' condition commands.
package condition
31 changes: 31 additions & 0 deletions pkg/commands/alias/vcl/condition/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package condition

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/condition"

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

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

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

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

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 = "condition"

// 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 VCL conditions").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/vcl/condition/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package condition

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/condition"

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

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

// NewUpdateCommand returns a usable command registered under the parent.
func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateCommand {
c := UpdateCommand{newcmd.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 vcl condition update' command instead.")
return c.UpdateCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/custom/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package custom

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/custom"

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

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

// NewCreateCommand returns a usable command registered under the parent.
func NewCreateCommand(parent argparser.Registerer, g *global.Data) *CreateCommand {
c := CreateCommand{newcmd.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 vcl custom create' command instead.")
return c.CreateCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/custom/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package custom

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/custom"

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

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

// NewDeleteCommand returns a usable command registered under the parent.
func NewDeleteCommand(parent argparser.Registerer, g *global.Data) *DeleteCommand {
c := DeleteCommand{newcmd.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 vcl custom delete' command instead.")
return c.DeleteCommand.Exec(in, out)
}
29 changes: 29 additions & 0 deletions pkg/commands/alias/vcl/custom/describe.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package custom

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/custom"

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

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

// NewDescribeCommand returns a usable command registered under the parent.
func NewDescribeCommand(parent argparser.Registerer, g *global.Data) *DescribeCommand {
c := DescribeCommand{newcmd.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 vcl custom describe' command instead.")
return c.DescribeCommand.Exec(in, out)
}
2 changes: 2 additions & 0 deletions pkg/commands/alias/vcl/custom/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package custom contains deprecated aliases for the 'service vcl' custom commands.
package custom
31 changes: 31 additions & 0 deletions pkg/commands/alias/vcl/custom/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package custom

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/custom"

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

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

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

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

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 = "custom"

// 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 custom VCL files").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/vcl/custom/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package custom

import (
"io"

newcmd "github.com/fastly/cli/pkg/commands/service/vcl/custom"

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

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

// NewUpdateCommand returns a usable command registered under the parent.
func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateCommand {
c := UpdateCommand{newcmd.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 vcl custom update' command instead.")
return c.UpdateCommand.Exec(in, out)
}
Loading