mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
refactoring of code
This commit is contained in:
@@ -25,8 +25,7 @@ SOFTWARE.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/jkaninda/mysql-bkup/internal"
|
||||
"github.com/jkaninda/mysql-bkup/pkg/logger"
|
||||
"github.com/jkaninda/mysql-bkup/pkg"
|
||||
"github.com/jkaninda/mysql-bkup/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -37,9 +36,9 @@ var BackupCmd = &cobra.Command{
|
||||
Example: utils.BackupExample,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
internal.StartBackup(cmd)
|
||||
pkg.StartBackup(cmd)
|
||||
} else {
|
||||
logger.Fatal(`"backup" accepts no argument %q`, args)
|
||||
utils.Fatal(`"backup" accepts no argument %q`, args)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ SOFTWARE.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/jkaninda/mysql-bkup/internal"
|
||||
"github.com/jkaninda/mysql-bkup/pkg/logger"
|
||||
"github.com/jkaninda/mysql-bkup/pkg"
|
||||
"github.com/jkaninda/mysql-bkup/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -35,9 +35,9 @@ var MigrateCmd = &cobra.Command{
|
||||
Short: "Migrate database from a source database to a target database",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
internal.StartMigration(cmd)
|
||||
pkg.StartMigration(cmd)
|
||||
} else {
|
||||
logger.Fatal(`"migrate" accepts no argument %q`, args)
|
||||
utils.Fatal(`"migrate" accepts no argument %q`, args)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
import (
|
||||
"github.com/jkaninda/mysql-bkup/internal"
|
||||
"github.com/jkaninda/mysql-bkup/pkg/logger"
|
||||
"github.com/jkaninda/mysql-bkup/pkg"
|
||||
"github.com/jkaninda/mysql-bkup/utils"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -36,9 +35,9 @@ var RestoreCmd = &cobra.Command{
|
||||
Example: utils.RestoreExample,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
internal.StartRestore(cmd)
|
||||
pkg.StartRestore(cmd)
|
||||
} else {
|
||||
logger.Fatal(`"restore" accepts no argument %q`, args)
|
||||
utils.Fatal(`"restore" accepts no argument %q`, args)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/jkaninda/mysql-bkup/utils"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
)
|
||||
@@ -41,6 +42,6 @@ var VersionCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func Version() {
|
||||
fmt.Printf("Version: %s \n", appVersion)
|
||||
fmt.Printf("Version: %s \n", utils.Version)
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user