Skip to content

Commit afa6c61

Browse files
committed
update alias root.go file to use argparser.Base
1 parent c2eec90 commit afa6c61

File tree

1 file changed

+13
-9
lines changed
  • pkg/commands/alias/dictionaryentry

1 file changed

+13
-9
lines changed

pkg/commands/alias/dictionaryentry/root.go

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

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

12-
// RootCommand wraps the RootCommand from the servicedictionaryentry 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-
*servicedictionaryentry.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 = "dictionary-entry"
19+
20+
// NewRootCommand returns a new command registered in the parent.
1821
func NewRootCommand(parent argparser.Registerer, g *global.Data) *RootCommand {
19-
c := RootCommand{servicedictionaryentry.NewRootCommand(parent, g)}
20-
c.CmdClause.Hidden()
22+
var c RootCommand
23+
c.Globals = g
24+
c.CmdClause = parent.Command(CommandName, "Manipulate Fastly edge dictionary items").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)