forked from x-motemen/ghq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
40 lines (34 loc) · 724 Bytes
/
Copy pathmain.go
File metadata and controls
40 lines (34 loc) · 724 Bytes
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
package main
import (
"fmt"
"os"
"github.com/urfave/cli/v2"
"github.com/x-motemen/ghq/logger"
)
const version = "1.5.0"
var revision = "HEAD"
func main() {
if err := newApp().Run(os.Args); err != nil {
exitCode := 1
if excoder, ok := err.(cli.ExitCoder); ok {
exitCode = excoder.ExitCode()
}
logger.Log("error", err.Error())
os.Exit(exitCode)
}
}
func newApp() *cli.App {
app := cli.NewApp()
app.Name = "ghq"
app.Usage = "Manage remote repository clones"
app.Version = fmt.Sprintf("%s (rev:%s)", version, revision)
app.Authors = []*cli.Author{{
Name: "motemen",
Email: "motemen@gmail.com",
}, {
Name: "Songmu",
Email: "y.songmu@gmail.com",
}}
app.Commands = commands
return app
}