fix: show account relationship by default
This is a breaking change. Changes: - Show the relationship between the user and the account by default. - Remove the show-relationship flag. - Add the skip-relationship flag so that users can set this to true if they don't want to display the relationship.
This commit is contained in:
parent
55b93c6586
commit
c8ee788832
2 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ const (
|
|||
flagNotify = "notify"
|
||||
flagFrom = "from"
|
||||
flagType = "type"
|
||||
flagShowRelationship = "show-relationship"
|
||||
flagSkipRelationship = "skip-relationship"
|
||||
flagShowPreferences = "show-preferences"
|
||||
flagShowReposts = "show-reposts"
|
||||
flagStatusID = "status-id"
|
||||
|
|
|
@ -13,7 +13,7 @@ type ShowExecutor struct {
|
|||
*flag.FlagSet
|
||||
topLevelFlags TopLevelFlags
|
||||
myAccount bool
|
||||
showAccountRelationship bool
|
||||
skipAccountRelationship bool
|
||||
showUserPreferences bool
|
||||
resourceType string
|
||||
accountName string
|
||||
|
@ -31,7 +31,7 @@ func NewShowExecutor(tlf TopLevelFlags, name, summary string) *ShowExecutor {
|
|||
}
|
||||
|
||||
command.BoolVar(&command.myAccount, flagMyAccount, false, "set to true to lookup your account")
|
||||
command.BoolVar(&command.showAccountRelationship, flagShowRelationship, false, "show your relationship to the specified account")
|
||||
command.BoolVar(&command.skipAccountRelationship, flagSkipRelationship, false, "set to true to skip showing your relationship to the specified account")
|
||||
command.BoolVar(&command.showUserPreferences, flagShowPreferences, false, "show your preferences")
|
||||
command.StringVar(&command.resourceType, flagType, "", "specify the type of resource to display")
|
||||
command.StringVar(&command.accountName, flagAccountName, "", "specify the account name in full (username@domain)")
|
||||
|
@ -110,7 +110,7 @@ func (c *ShowExecutor) showAccount(gtsClient *client.Client) error {
|
|||
|
||||
fmt.Println(account)
|
||||
|
||||
if !c.myAccount && c.showAccountRelationship {
|
||||
if !c.myAccount && !c.skipAccountRelationship {
|
||||
relationship, err := gtsClient.GetAccountRelationship(account.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to retrieve the relationship to this account; %w", err)
|
||||
|
|
Loading…
Reference in a new issue