[fix] Testing fixes
- sqlite error handling and wrapping - more responsive commands - database updates
This commit is contained in:
@@ -12,15 +12,20 @@ import (
|
||||
)
|
||||
|
||||
var activeCmd = &cobra.Command{
|
||||
Use: "active",
|
||||
Example: "mctl server active <server>",
|
||||
Short: "sets the active server to run commands on",
|
||||
Use: "active",
|
||||
Example: "mctl server active <server>",
|
||||
Short: "sets the active server to run commands on",
|
||||
SilenceUsage: true,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
db, err := database.New()
|
||||
cobra.CheckErr(err)
|
||||
defer db.Close()
|
||||
|
||||
err = db.SetActiveServer(args[0])
|
||||
if err.Error() == ErrInit {
|
||||
fmt.Println(ErrInitRsp)
|
||||
return
|
||||
}
|
||||
cobra.CheckErr(err)
|
||||
|
||||
fmt.Println("Active server updated")
|
||||
|
||||
Reference in New Issue
Block a user