Skip to content

Commit

Permalink
♻️ list: implement Cmd interface
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed Sep 28, 2020
1 parent 667ae5b commit 3c3318e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ import (
"text/tabwriter"
)

// TODO: inject io.Writer for output
func ListCmd(ctx context.Context) error {
var _ Cmd = &ListCmd{}

type ListCmd struct{}

func (c *ListCmd) MaxArg() int {
return 0
}

func (c *ListCmd) Usage() string {
return "Generate the skeleton code with the test file by id"
}

func (c *ListCmd) Run(ctx context.Context, _ []string) error {
cli, err := NewLeetCode()
if err != nil {
return err
Expand Down

0 comments on commit 3c3318e

Please sign in to comment.