diff --git a/internal/flags/deactivate.go b/internal/flags/deactivate.go index 58828b63..87a16941 100644 --- a/internal/flags/deactivate.go +++ b/internal/flags/deactivate.go @@ -3,10 +3,13 @@ package flags import ( "fmt" "rpc/pkg/utils" + + log "github.com/sirupsen/logrus" ) func (f *Flags) handleDeactivateCommand() int { f.amtDeactivateCommand.BoolVar(&f.Local, "local", false, "Execute command to AMT directly without cloud interaction") + if len(f.commandLineArgs) == 2 { f.amtDeactivateCommand.PrintDefaults() return utils.IncorrectCommandLineParameters @@ -30,5 +33,9 @@ func (f *Flags) handleDeactivateCommand() int { } } } + + if f.Password != "" && !f.UseACM { + log.Warn("Password not required for CCM deactivation") + } return utils.Success } diff --git a/internal/flags/deactivate_test.go b/internal/flags/deactivate_test.go index 00f22822..4e98d63a 100644 --- a/internal/flags/deactivate_test.go +++ b/internal/flags/deactivate_test.go @@ -75,7 +75,7 @@ func TestHandleDeactivateCommandWithForce(t *testing.T) { } func TestHandleLocalDeactivation(t *testing.T) { - args := []string{"./rpc", "deactivate", "-local"} + args := []string{"./rpc", "deactivate", "-local", "password"} flags := NewFlags(args) errCode := flags.ParseFlags() assert.Equal(t, errCode, utils.Success)