forked from Moldy-Community/moldy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.go
38 lines (29 loc) · 806 Bytes
/
install.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cmd
import (
//_"github.com/Moldy-Community/moldy/core/config"
"github.com/spf13/cobra"
)
var createInstall bool
// configCmd represents the config command
var installCmd = &cobra.Command{
Use: "install",
Short: "Search packages",
Long: `:
allow searching and extracting the content of a github packages on github
`,
Run: func(cmd *cobra.Command, args []string) {
if createInstall {
if flags,_:= cmd.Flags().GetBool("url");flags{
//do something
}else{
//packages.GetId().go
}
}
},
Example: "moldy i name-of-pkg or moldy install --url github.com/user/name",
Aliases: []string{"i", "ins"},
}
func init() {
rootCmd.AddCommand(installCmd)
installCmd.Flags().BooVarP(&createInstall, "url", false, "a command for download package")
}