Merged
Conversation
The `account` command displays information about the current user's account. Currently it displays the user's name, email, ID, account type, locale, referral link, paired status, and team info (if applicable).
Add an optional argument to the `account` command which allows it to look up other users by their account ID.
Collaborator
|
@waits what was your primary motivation for this command? As in, how are you using it in practice? |
Contributor
Author
|
@diwakergupta In order of potential usefulness (for myself, anyways, but hopefully for others as well):
|
cmd/account.go
Outdated
| w := new(tabwriter.Writer) | ||
| w.Init(os.Stdout, 4, 8, 1, ' ', 0) | ||
|
|
||
| switch len(args) { |
Collaborator
There was a problem hiding this comment.
If you add the len validations for this as well, you could simplify this to
if len(args) == 0 {
...
} else {
}
Validate the length of the `args` slice before accessing it. This allows the later switch statement to be simplified into an if/else block.
Collaborator
|
Thanks @waits ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
accountcommand displays information about the current user's account.Currently it displays the user's name, email, ID, account type, locale,
referral link, paired status, and team info (if applicable).
It also takes an optional account ID to look up instead of the current user. In this case it displays slightly less info than when displaying the current account (due to API restrictions).
It also displays the team name and member ID if applicable. I don't have a business account to test with, though, so please double-check that it works.
Examples: