Skip to content

Commit

Permalink
init gno mod tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
harry-hov committed Aug 7, 2023
1 parent 5d3be42 commit 98cbf29
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions gnovm/cmd/gno/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func newModCmd(io *commands.IO) *commands.Command {

cmd.AddSubCommands(
newModDownloadCmd(io),
newModTody(io),
)

return cmd
Expand All @@ -51,6 +52,20 @@ func newModDownloadCmd(io *commands.IO) *commands.Command {
)
}

func newModTody(io *commands.IO) *commands.Command {
return commands.NewCommand(
commands.Metadata{
Name: "tidy",
ShortUsage: "tidy",
ShortHelp: "Add missing and remove unused modules",
},
commands.NewEmptyConfig(),
func(_ context.Context, args []string) error {
return execModTidy(args, io)
},
)
}

func (c *modDownloadCfg) RegisterFlags(fs *flag.FlagSet) {
fs.StringVar(
&c.remote,
Expand Down Expand Up @@ -118,3 +133,13 @@ func execModDownload(cfg *modDownloadCfg, args []string, io *commands.IO) error

return nil
}

func execModTidy(args []string, io *commands.IO) error {
if len(args) > 0 {
return flag.ErrHelp
}

// TODO: Implementation

return nil
}

0 comments on commit 98cbf29

Please sign in to comment.