main.go 939 B raw
1
package main
2
3
import (
4
	"log"
5
	"os"
6
7
	"github.com/urfave/cli/v2"
8
)
9
10
func main() {
11
	app := &cli.App{
12
		Name:  "radlicalize",
13
		Usage: "A CLI tool used to clone either remote or local git repos to Radicle.xyz",
14
		Commands: []*cli.Command{
15
			{
16
				Name:    "local",
17
				Aliases: []string{"l"},
18
				Usage:   "Use to clone any local repos to Radicle",
19
				Flags: []cli.Flag{
20
					&cli.BoolFlag{
21
						Name:    "private",
22
						Aliases: []string{"p"},
23
						Usage:   "Use this flag if you want the repo to be private.",
24
					},
25
				},
26
				Action: func(ctx *cli.Context) error {
27
					private := ctx.Bool("private")
28
					return LocalClone(private)
29
				},
30
			},
31
			{
32
				Name:    "remote",
33
				Aliases: []string{"r"},
34
				Usage:   "Use to clone any remote public repos on Github to Radicle",
35
				Action: func(ctx *cli.Context) error {
36
					return RemoteClone()
37
				},
38
			},
39
		},
40
	}
41
42
	if err := app.Run(os.Args); err != nil {
43
		log.Fatal(err)
44
	}
45
}