Added structure for Search Commands
This commit is contained in:
parent
7ff62e1a06
commit
aad0ce2c4e
2 changed files with 28 additions and 0 deletions
27
Commands/SearchCommand.go
Normal file
27
Commands/SearchCommand.go
Normal file
|
|
@ -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
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,7 @@ func main(){
|
||||||
Commands: []*cli.Command {
|
Commands: []*cli.Command {
|
||||||
Commands.PushCommand(),
|
Commands.PushCommand(),
|
||||||
Commands.PullCommand(),
|
Commands.PullCommand(),
|
||||||
|
Commands.SearchCommand(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue