[fix] Testing fixes
- sqlite error handling and wrapping - more responsive commands - database updates
This commit is contained in:
@@ -17,10 +17,11 @@ import (
|
||||
)
|
||||
|
||||
var addCmd = &cobra.Command{
|
||||
Use: "add",
|
||||
Example: "mctl server add",
|
||||
Short: "Saves a new server configuration",
|
||||
Long: `Saves server address, alias, port, and password to the database.`,
|
||||
Use: "add",
|
||||
Example: "mctl server add",
|
||||
Short: "Saves a new server configuration",
|
||||
Long: `Saves server address, alias, port, and password to the database.`,
|
||||
SilenceUsage: true,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
|
||||
@@ -62,6 +63,10 @@ var addCmd = &cobra.Command{
|
||||
Port: fp,
|
||||
Password: base64.StdEncoding.EncodeToString(ps),
|
||||
})
|
||||
if err.Error() == ErrInit {
|
||||
fmt.Println(ErrInitRsp)
|
||||
return
|
||||
}
|
||||
cobra.CheckErr(err)
|
||||
|
||||
fmt.Println("Server saved")
|
||||
|
||||
Reference in New Issue
Block a user