-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.go
38 lines (31 loc) · 990 Bytes
/
main.go
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
// Copyright (c) 2020-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
package main
import (
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "awat",
Long: "The Automatic Workspace Archive Translator is a microservice that converts workspaces from various formats into the Mattermost Bulk Import Format such that they can be imported into Mattermost Cloud",
Short: "The Automatic Workspace Archive Translator",
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return serverCmd.RunE(cmd, args)
},
// SilenceErrors allows us to explicitly log the error returned from rootCmd below.
SilenceErrors: true,
}
func init() {
rootCmd.AddCommand(serverCmd)
rootCmd.AddCommand(translationCmd)
rootCmd.AddCommand(importCmd)
rootCmd.AddCommand(schemaCmd)
}
func main() {
if err := rootCmd.Execute(); err != nil {
logger.WithError(err).Error("command failed")
os.Exit(1)
}
}