-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathmain.go
More file actions
42 lines (36 loc) · 918 Bytes
/
main.go
File metadata and controls
42 lines (36 loc) · 918 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
41
42
package main
import (
"fmt"
"log"
"os"
"path/filepath"
"github.com/movsb/taoblog/cmd/client"
"github.com/movsb/taoblog/cmd/imports"
"github.com/movsb/taoblog/cmd/server"
"github.com/movsb/taoblog/cmd/tools"
"github.com/movsb/taoblog/cmd/tools/conv"
"github.com/movsb/taoblog/modules/version"
_ "github.com/movsb/taoblog/setup/tool-deps"
"github.com/spf13/cobra"
)
func init() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
version.ForceEnableDevMode = os.Getenv(`DEV`)
cobra.EnableCommandSorting = false
}
func main() {
rootCmd := &cobra.Command{
Use: filepath.Base(os.Args[0]),
Short: `TaoBlog client & server program.`,
}
server.AddCommands(rootCmd)
client.AddCommands(rootCmd)
imports.AddCommands(rootCmd)
tools.AddCommands(rootCmd)
conv.AddCommands(rootCmd)
version.AddCommands(rootCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}