misc: Rename mgmtmain to lib and remove global package

This refactor should make it cleaner to use mgmt.
This commit is contained in:
James Shubin
2016-12-08 23:00:53 -05:00
parent 1f415db44f
commit 4803be1987
24 changed files with 202 additions and 157 deletions

16
main.go
View File

@@ -21,7 +21,14 @@ import (
"fmt"
"os"
"github.com/purpleidea/mgmt/mgmtmain"
mgmt "github.com/purpleidea/mgmt/lib"
)
// These constants are some global variables that are used throughout the code.
const (
DEBUG = false // add additional log messages
TRACE = false // add execution flow log messages
VERBOSE = false // add extra log message output
)
// set at compile time
@@ -31,7 +38,12 @@ var (
)
func main() {
if err := mgmtmain.CLI(program, version); err != nil {
flags := mgmt.Flags{
Debug: DEBUG,
Trace: TRACE,
Verbose: VERBOSE,
}
if err := mgmt.CLI(program, version, flags); err != nil {
fmt.Println(err)
os.Exit(1)
return