main.go 875 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2018 Twitch Interactive, Inc. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License"). You may not
  4. // use this file except in compliance with the License. A copy of the License is
  5. // located at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // or in the "license" file accompanying this file. This file is distributed on
  10. // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  11. // express or implied. See the License for the specific language governing
  12. // permissions and limitations under the License.
  13. package main
  14. import (
  15. "flag"
  16. "fmt"
  17. "os"
  18. "go-common/app/tool/liverpc/protoc-gen-liverpc/gen"
  19. )
  20. func main() {
  21. versionFlag := flag.Bool("version", false, "print version and exit")
  22. flag.Parse()
  23. if *versionFlag {
  24. fmt.Println(gen.Version)
  25. os.Exit(0)
  26. }
  27. g := bmGenerator()
  28. gen.Main(g)
  29. }