Skip to content

Commit 8872fc6

Browse files
authored
Merge branch 'main' into rcaril/CDTOOL-1255-move-dictionary-entry-under-service
2 parents afa6c61 + fbf0bb5 commit 8872fc6

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

pkg/commands/alias/backend/root.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,29 @@ package backend
33
import (
44
"io"
55

6-
servicebackend "github.com/fastly/cli/pkg/commands/service/backend"
7-
86
"github.com/fastly/cli/pkg/argparser"
97
"github.com/fastly/cli/pkg/global"
108
)
119

12-
// RootCommand wraps the RootCommand from the servicebackend package.
10+
// RootCommand is the parent command for all subcommands in this package.
11+
// It should be installed under the primary root command.
1312
type RootCommand struct {
14-
*servicebackend.RootCommand
13+
argparser.Base
14+
// no flags
1515
}
1616

17-
// NewRootCommand returns a usable command registered under the parent.
17+
// CommandName is the string to be used to invoke this command.
18+
const CommandName = "backend"
19+
20+
// NewRootCommand returns a new command registered in the parent.
1821
func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
19-
c := RootCommand{servicebackend.NewRootCommand(parent, g)}
20-
c.CmdClause.Hidden()
22+
var c RootCommand
23+
c.Globals = g
24+
c.CmdClause = parent.Command(CommandName, "Manipulate Fastly service version backends").Hidden()
2125
return &c
2226
}
2327

2428
// Exec implements the command interface.
25-
func (c *RootCommand) Exec(in io.Reader, out io.Writer) error {
26-
return c.RootCommand.Exec(in, out)
29+
func (c *RootCommand) Exec(_ io.Reader, _ io.Writer) error {
30+
panic("unreachable")
2731
}

pkg/commands/alias/healthcheck/root.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,29 @@ package healthcheck
33
import (
44
"io"
55

6-
servicehealthcheck "github.com/fastly/cli/pkg/commands/service/healthcheck"
7-
86
"github.com/fastly/cli/pkg/argparser"
97
"github.com/fastly/cli/pkg/global"
108
)
119

12-
// RootCommand wraps the RootCommand from the servicehealthcheck package.
10+
// RootCommand is the parent command for all subcommands in this package.
11+
// It should be installed under the primary root command.
1312
type RootCommand struct {
14-
*servicehealthcheck.RootCommand
13+
argparser.Base
14+
// no flags
1515
}
1616

17-
// NewRootCommand returns a usable command registered under the parent.
17+
// CommandName is the string to be used to invoke this command.
18+
const CommandName = "healthcheck"
19+
20+
// NewRootCommand returns a new command registered in the parent.
1821
func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
19-
c := RootCommand{servicehealthcheck.NewRootCommand(parent, g)}
20-
c.CmdClause.Hidden()
22+
var c RootCommand
23+
c.Globals = g
24+
c.CmdClause = parent.Command(CommandName, "Manipulate Fastly service version healthchecks").Hidden()
2125
return &c
2226
}
2327

2428
// Exec implements the command interface.
25-
func (c *RootCommand) Exec(in io.Reader, out io.Writer) error {
26-
return c.RootCommand.Exec(in, out)
29+
func (c *RootCommand) Exec(_ io.Reader, _ io.Writer) error {
30+
panic("unreachable")
2731
}

0 commit comments

Comments
 (0)