-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
63 lines (56 loc) · 1.32 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
55
56
57
58
59
60
61
62
63
package main
import (
"fmt"
"log"
"os"
"github.com/Praseetha-KR/strand-cli/cmd"
"github.com/urfave/cli/v2"
)
const (
appName = "strand"
description = "Random String Generator"
version = "v0.0.3"
author = "Praseetha KR"
email = "praseetha04@gmail.com"
header = `
$$\ $$\
$$ | $$ |
$$$$$$$\ $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$ |
$$ _____|\_$$ _| $$ __$$\ \____$$\ $$ __$$\ $$ __$$ |
\$$$$$$\ $$ | $$ | \__|$$$$$$$ |$$ | $$ |$$ / $$ |
\____$$\ $$ |$$\ $$ | $$ __$$ |$$ | $$ |$$ | $$ |
$$$$$$$ | \$$$$ |$$ | \$$$$$$$ |$$ | $$ |\$$$$$$$ |
\_______/ \____/ \__| \_______|\__| \__| \_______|
`
)
func main() {
if err := newApp().Run(os.Args); err != nil {
log.Fatal(err)
}
}
func newApp() *cli.App {
app := &cli.App{
Name: appName,
Usage: description,
Version: version,
Authors: []*cli.Author{
&cli.Author{
Name: author,
Email: email,
},
},
Commands: []*cli.Command{
cmd.StringCmd,
cmd.AlphaCmd,
cmd.AlphaNumericCmd,
cmd.NumericCmd,
cmd.URLSafeCmd,
cmd.HexCmd,
cmd.BinaryCmd,
cmd.PasswordCmd,
cmd.FromCmd,
},
}
cli.AppHelpTemplate = fmt.Sprintf(`%s%s`, header, cli.AppHelpTemplate)
return app
}