Skip to content

Commit

Permalink
chore: add command usage error
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaninda committed Oct 20, 2024
1 parent 2c6336e commit 1dcb958
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var BackupCmd = &cobra.Command{
if len(args) == 0 {
pkg.StartBackup(cmd)
} else {
utils.Fatal("Error, no argument required")
utils.Fatal(`"backup" accepts no argument %q`, args)
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var MigrateCmd = &cobra.Command{
if len(args) == 0 {
pkg.StartMigration(cmd)
} else {
utils.Fatal("Error, no argument required")
utils.Fatal(`"migrate" accepts no argument %q`, args)

}

Expand Down
2 changes: 1 addition & 1 deletion cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var RestoreCmd = &cobra.Command{
if len(args) == 0 {
pkg.StartRestore(cmd)
} else {
utils.Fatal("Error, no argument required")
utils.Fatal(`"restore" accepts no argument %q`, args)

}

Expand Down
1 change: 0 additions & 1 deletion pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ func initAWSConfig() *AWSConfig {
func initBackupConfig(cmd *cobra.Command) *BackupConfig {
utils.SetEnv("STORAGE_PATH", storagePath)
utils.GetEnv(cmd, "cron-expression", "BACKUP_CRON_EXPRESSION")
utils.GetEnv(cmd, "period", "BACKUP_CRON_EXPRESSION")
utils.GetEnv(cmd, "path", "REMOTE_PATH")
//Get flag value and set env
remotePath := utils.GetEnvVariable("REMOTE_PATH", "SSH_REMOTE_PATH")
Expand Down

0 comments on commit 1dcb958

Please sign in to comment.