diff --git a/cmd/root.go b/cmd/root.go index 20cc0f0..7acd953 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -49,6 +49,10 @@ func init() { rootCmd.PersistentFlags().IntP("port", "p", 3306, "Set database port") rootCmd.PersistentFlags().StringVarP(&operation, "operation", "o", "", "Set operation, for old version only") + rootCmd.PersistentFlags().StringP("mode", "m", "default", "Set execution mode. default or scheduled") + rootCmd.PersistentFlags().StringP("period", "", "0 1 * * *", "Set schedule period time") + rootCmd.PersistentFlags().BoolP("disable-compression", "", false, "Disable backup compression") + rootCmd.AddCommand(VersionCmd) rootCmd.AddCommand(BackupCmd) rootCmd.AddCommand(RestoreCmd) diff --git a/utils/constant.go b/utils/constant.go index 77198e1..006fcab 100644 --- a/utils/constant.go +++ b/utils/constant.go @@ -4,7 +4,8 @@ const Notice = "Please remove --operation flag.\n" + "Use: \n" + "- backup for database backup operation [eg: bkup backup -d database_name ...]\n" + "- restore for database restore operation [eg. bkup restore -d database_name ...]\n" + - "We are sorry for this inconvenient" + "Example: bkup backup --storage s3 ...( instead of < bkup --operation backup >)\n" + + "We are sorry for this inconvenient\n" const RestoreExample = "mysql-bkup restore --dbname database --file db_20231219_022941.sql.gz\n" + "bkup restore --dbname database --storage s3 --path /custom-path --file db_20231219_022941.sql.gz" const BackupExample = "mysql-bkup backup --dbname database --disable-compression\n" +