File tree Expand file tree Collapse file tree 2 files changed +26
-18
lines changed
Expand file tree Collapse file tree 2 files changed +26
-18
lines changed Original file line number Diff line number Diff line change @@ -3,25 +3,29 @@ package backend
33import (
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.
1312type 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.
1821func 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}
Original file line number Diff line number Diff line change @@ -3,25 +3,29 @@ package healthcheck
33import (
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.
1312type 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.
1821func 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}
You can’t perform that action at this time.
0 commit comments