Repository: nats-io/nsc (go)

Issue:
nsc pull shows incorrect message when a newer account is present locally
### What version were you using?

nsc version 2.8.0
nats-server version 2.9.22

### What environment was the server running in?

Linux VM, arm64, docker images:

- nats:2.9.22-scratch
- natsio/nats-box:0.13.9


### Is this defect reproducible?

Yes.
1. run `nsc pull -A`
2. update an account programmatically or on a different host
3. run `nsc pull -A` again



### Given the capability you are leveraging, describe your expectation?

```
$ nsc pull -A
[ERR ] pulled "SYS" from the account server:
       [ OK ] stored account "tnt-default"
       [ OK ] stored account "SYS"
       [ERR ] local jwt for "tnt-default" is newer than remote version - specify --force to overwrite

Usage:
  nsc pull [flags]
…
```
I would expect `nsc pull -A --force` to work

### Given the expectation, what is the defect you are observing?

```
$ nsc pull -A --force
Error: unknown flag: --force
Usage:
  nsc pull [flags]

Flags:
  -a, --account string          account name
  -A, --all                     operator and all accounts under the operator
  -h, --help                    help for pull
  -F, --overwrite-newer         overwrite local JWTs that are newer than remote
...
```

Pull request:
Fixed incorrect error message in nsc pull
Fixes #607 

Patch:
diff --git a/cmd/pull.go b/cmd/pull.go
index 0d72c1b..d75600c 100644
--- a/cmd/pull.go
+++ b/cmd/pull.go
@@ -231,7 +231,7 @@ func (p *PullParams) maybeStoreJWT(ctx ActionCtx, sub *store.Report, token strin
 	}
 	remote := remoteClaim.IssuedAt
 	if (orig > remote) && !p.Overwrite {
-		sub.AddError("local jwt for %q is newer than remote version - specify --force to overwrite", remoteClaim.Name)
+		sub.AddError("local jwt for %q is newer than remote version - specify --overwrite-newer to overwrite", remoteClaim.Name)
 		return
 	}
 	if err := ctx.StoreCtx().Store.StoreRaw([]byte(token)); err != nil {
diff --git a/cmd/reissueoperator.go b/cmd/reissueoperator.go
index eb65f2e..1a6722b 100644
--- a/cmd/reissueoperator.go
+++ b/cmd/reissueoperator.go
@@ -149,7 +149,7 @@ func (p *reIssueOperator) Run(ctx ActionCtx) (store.Status, error) {
 	}
 	r.AddOK("operator %q successfully changed identity to: %s", op.Name, opPub)
 	if p.turnIntoSigningKey {
-		r.AddOK("old operator key %q turned into signing key", opPub)
+		r.AddOK("old operator key %q turned into signing key", oldPubKey)
 		return r, nil
 	}
 	accounts, err := s.ListSubContainers(store.Accounts)


Test patch:
diff --git a/cmd/reissueoperator_test.go b/cmd/reissueoperator_test.go
index e495736..c3d9efb 100644
--- a/cmd/reissueoperator_test.go
+++ b/cmd/reissueoperator_test.go
@@ -35,11 +35,18 @@ func Test_ReIssue(t *testing.T) {
 	// add testing account
 	ts.AddAccount(t, "A")
 
-	_, _, err = ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
+	_, stderr, err := ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
 	require.NoError(t, err)
 	op3, err := ts.Store.ReadOperatorClaim()
 	require.NoError(t, err)
 	require.NotEqual(t, op2.Subject, op3.Subject)
+	require.Equal(
+		t,
+		stderr,
+		"[ OK ] operator \"O\" successfully changed identity to: "+op3.Subject+"\n"+
+			"[ OK ] old operator key \""+op2.Subject+"\" turned into signing key\n"+
+			"all jobs succeeded\n",
+	)
 	require.Len(t, op3.SigningKeys, 1)
 	require.True(t, op3.SigningKeys.Contains(op2.Subject))