awscli-login icon indicating copy to clipboard operation
awscli-login copied to clipboard

Pedantic return codes when user is already logged in or logged out

Open JonRoma opened this issue 3 years ago • 2 comments

If I do an aws logout to ensure my session has been terminated, I get the following if I happen to have logged out already.

: aws logout
Already logged out!
: echo $?
3

I have no beef with the message, but I question whether the command should return non-zero. Since the logout is in this case a no-op, I don't think it should be an error to have the command's outcome be the state that one wants in the first place. :-)

Likewise, similar behavior takes place when I try to log in and have already done so, and I suggest reviewing this as well. I don't think we need the exclamation point in either case, because there is nothing demanding a user's urgent attention. :-)

: aws login
Already logged in!
: echo $?
2

If it is feasible and practical, it would be nice if the Already logged in! message listed the account name, number or role.

JonRoma avatar Mar 25 '21 19:03 JonRoma

Agreed. Producing no output when a user is already logged out would be most appropriate, since it's still a success.

When logging in, we probably do need an error, as a user might be trying to switch accounts, so it would make sense to output what account they are logged in with.

edthedev avatar Mar 25 '21 19:03 edthedev

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Mar 27 '24 13:03 github-actions[bot]