grim/hgkeeper

closing merged branch
termdumb
2019-04-18, Gary Kramlich
50c6ec130656
closing merged branch
package main
import (
"os"
"github.com/alecthomas/kong"
log "github.com/sirupsen/logrus"
"bitbucket.org/rw_grim/hgkeeper/setup"
"bitbucket.org/rw_grim/hgkeeper/ssh"
)
type commands struct {
ReposPath string `flag name:"repos-path" default:"repos" help:"the directory where the repository are stored"`
Serve ssh.ServeCommand `cmd help:"run the ssh server"`
Setup setup.SetupCommand `cmd help:"inital setup for the server"`
}
func init() {
log.SetOutput(os.Stdout)
log.SetLevel(log.DebugLevel)
fmter := &log.TextFormatter{
FullTimestamp: true,
}
switch os.Getenv("TERM") {
case "win":
fallthrough
case "dumb":
fmter.DisableColors = true
}
log.SetFormatter(fmter)
}
func main() {
cmd := commands{}
ctx := kong.Parse(&cmd)
err := ctx.Run(cmd.ReposPath)
ctx.FatalIfErrorf(err)
}