diff --git a/Commands/SearchCommand.go b/Commands/SearchCommand.go new file mode 100644 index 0000000..210f242 --- /dev/null +++ b/Commands/SearchCommand.go @@ -0,0 +1,27 @@ +package Commands + +import ( + "fmt" + "github.com/urfave/cli/v2" + "log" +) + +func SearchCommand() *cli.Command{ + return &cli.Command { + Name: "search", + Usage: "Seaches a packages", + Description: "Sends a search request to the default registry server, or to a user-defined registry server", + HelpName: "search", + Action: func(c *cli.Context) error{ + //Do Stuff + return nil + }, + OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error { + if err != nil { + fmt.Printf("[ERROR]%s", err.Error()) + log.Fatal(err) + } + return err + }, + } +} diff --git a/lpm-cli.go b/lpm-cli.go index 96409cc..084f10b 100644 --- a/lpm-cli.go +++ b/lpm-cli.go @@ -19,6 +19,7 @@ func main(){ Commands: []*cli.Command { Commands.PushCommand(), Commands.PullCommand(), + Commands.SearchCommand(), }, }