[fix] Testing fixes
- sqlite error handling and wrapping - more responsive commands - database updates
This commit is contained in:
@@ -18,10 +18,11 @@ var (
|
||||
)
|
||||
|
||||
var runCmd = &cobra.Command{
|
||||
Use: "run",
|
||||
Example: "mctl command run -s <server> <command> args...",
|
||||
Short: "Runs a saved command on a server",
|
||||
Long: `Runs the named command with the provided args on the default/active server unless -s is specified`,
|
||||
Use: "run",
|
||||
Example: "mctl command run -s <server> <command> args...",
|
||||
Short: "Runs a saved command on a server",
|
||||
Long: `Runs the named command with the provided args on the default/active server unless -s is specified`,
|
||||
SilenceUsage: true,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cname := args[0]
|
||||
|
||||
@@ -32,6 +33,10 @@ var runCmd = &cobra.Command{
|
||||
defer db.Close()
|
||||
|
||||
crun, err := db.GetCmd(cname)
|
||||
if err.Error() == ErrInit {
|
||||
fmt.Println(ErrInitRsp)
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user