From c8ee7888322241929c96500e78bd468e64fb029b Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Thu, 23 May 2024 18:22:13 +0100 Subject: [PATCH] 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. --- internal/executor/const.go | 2 +- internal/executor/show.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/executor/const.go b/internal/executor/const.go index 0d61614..1f0141f 100644 --- a/internal/executor/const.go +++ b/internal/executor/const.go @@ -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" diff --git a/internal/executor/show.go b/internal/executor/show.go index 6930d07..98c5b4c 100644 --- a/internal/executor/show.go +++ b/internal/executor/show.go @@ -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)