From 094bbc8760641fa8f64fba70dba3e2765751af01 Mon Sep 17 00:00:00 2001 From: Ashish Rao Date: Tue, 10 Dec 2019 15:48:58 +0530 Subject: [PATCH] fix(cli): mark from flag as required for squash (close #3400) (#3500) --- cli/commands/migrate_squash.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/commands/migrate_squash.go b/cli/commands/migrate_squash.go index 3b81b1907c1..e91ffa17a5f 100644 --- a/cli/commands/migrate_squash.go +++ b/cli/commands/migrate_squash.go @@ -12,6 +12,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" + "github.com/spf13/viper" mig "github.com/hasura/graphql-engine/cli/migrate/cmd" @@ -51,6 +52,9 @@ func newMigrateSquashCmd(ec *cli.ExecutionContext) *cobra.Command { f.String("access-key", "", "access key for Hasura GraphQL Engine") f.MarkDeprecated("access-key", "use --admin-secret instead") + // mark flag as required + migrateSquashCmd.MarkFlagRequired("from") + // need to create a new viper because https://github.com/spf13/viper/issues/233 v.BindPFlag("endpoint", f.Lookup("endpoint")) v.BindPFlag("admin_secret", f.Lookup("admin-secret"))