awscli-login
awscli-login copied to clipboard
Pedantic return codes when user is already logged in or logged out
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.
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.
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.