github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cmd/docgen/main.go (about) 1 // Copyright 2017 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package main 12 13 import ( 14 "fmt" 15 "os" 16 17 "github.com/spf13/cobra" 18 ) 19 20 var cmds []*cobra.Command 21 var quiet bool 22 23 func main() { 24 rootCmd := func() *cobra.Command { 25 cmd := &cobra.Command{ 26 Use: "docgen", 27 Short: "docgen generates documentation for cockroachdb's SQL functions and grammar", 28 } 29 cmd.PersistentFlags().BoolVarP(&quiet, "quiet", "q", false, "suppress output where possible") 30 cmd.AddCommand(cmds...) 31 return cmd 32 }() 33 if err := rootCmd.Execute(); err != nil { 34 fmt.Println(err) 35 os.Exit(1) 36 } 37 }