-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (49 loc) · 1.16 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"log"
"os"
"github.com/urfave/cli/v2"
)
func main() {
app := cli.NewApp()
app.Name = "The CLI for Ansible that you always needed."
app.Usage = "Create Ansible projects, add new roles, and manage dependencies."
app.Commands = []*cli.Command{
{
Name: "create",
HelpName: "create",
Action: CreateAnsibleProjectAction,
ArgsUsage: ` `,
Usage: "Creates a new Ansible project in the current directory",
Description: "Create a new Ansible project",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "name",
Usage: "Name of the project",
},
},
},
{
Name: "new-role",
HelpName: "new-role",
Action: CreateAnsibleRoleAction,
ArgsUsage: ` `,
Usage: "Creates a new Ansible role in a specified directory",
Description: "Creates a new Ansible role in a specified directory",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "name",
Usage: "Name of the role",
},
&cli.StringFlag{
Name: "project",
Usage: "Path of the project to create a role in it",
},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal((err))
}
}