THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

A command line tool to interact with Gitea servers, moved to https://gitea.com/gitea/tea
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1KB

  1. // Copyright 2018 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. // Tea is command line tool for Gitea.
  5. package main // import "code.gitea.io/tea"
  6. import (
  7. "log"
  8. "os"
  9. "strings"
  10. "code.gitea.io/tea/cmd"
  11. "code.gitea.io/tea/modules/setting"
  12. "github.com/urfave/cli"
  13. )
  14. // Version holds the current Gitea version
  15. var Version = "0.1.0-dev"
  16. // Tags holds the build tags used
  17. var Tags = ""
  18. func init() {
  19. setting.AppVer = Version
  20. setting.AppBuiltWith = formatBuiltWith(Tags)
  21. }
  22. func main() {
  23. app := cli.NewApp()
  24. app.Name = "Tea"
  25. app.Usage = "Command line tool to interact with Gitea"
  26. app.Description = ``
  27. app.Version = Version + formatBuiltWith(Tags)
  28. app.Commands = []cli.Command{
  29. cmd.CmdLogin,
  30. cmd.CmdLogout,
  31. cmd.CmdIssues,
  32. cmd.CmdPulls,
  33. cmd.CmdReleases,
  34. }
  35. err := app.Run(os.Args)
  36. if err != nil {
  37. log.Fatal(4, "Failed to run app with %s: %v", os.Args, err)
  38. }
  39. }
  40. func formatBuiltWith(Tags string) string {
  41. if len(Tags) == 0 {
  42. return ""
  43. }
  44. return " built with: " + strings.Replace(Tags, " ", ", ", -1)
  45. }