-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.go
32 lines (26 loc) · 1.01 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
package main
import (
"fmt"
"os"
"github.com/filhodanuvem/polyglot/cmd"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "Polyglot",
Short: "Polyglot tells you the (programming) languages that you speak",
Run: cmd.Run,
}
func main() {
rootCmd.Flags().StringP("username", "u", "", "Username")
rootCmd.Flags().StringP("path", "p", "/tmp/polyglot", "Path where to download the repositories")
rootCmd.Flags().StringP("provider", "", "github", "Repository Provider, options [github, gitlab]")
rootCmd.PersistentFlags().StringP("log", "l", "fatal", "Log verbosity, options [debug, info, warning, error, fatal]")
rootCmd.PersistentFlags().StringP("output", "o", "", "Path to log in a file")
rootCmd.Flags().BoolP("server", "s", false, "Run polyglot API Server")
rootCmd.PersistentFlags().StringP("host", "", "127.0.0.1", "IP address for the server")
rootCmd.PersistentFlags().StringP("port", "", "8080", "Port for the server")
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}