From a33e2e28157cc244c745d458bc73932b5572c8f2 Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Fri, 17 Nov 2023 07:26:03 -0600 Subject: [PATCH] Use shorthand flag constant Replace bare text to match recent changes to other projects. --- internal/config/constants.go | 4 ++++ internal/config/flags.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/config/constants.go b/internal/config/constants.go index 8862703c..4875b151 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -66,6 +66,10 @@ const ( tokenRetrievalAttemptsFlagHelp string = "Max token retrieval attempts." ) +// shorthandFlagSuffix is appended to short flag help text to emphasize that +// the flag is a shorthand version of a longer flag. +const shorthandFlagSuffix = " (shorthand)" + // Default flag settings if not overridden by user input const ( defaultHelp bool = false diff --git a/internal/config/flags.go b/internal/config/flags.go index 06c2d6a9..c09f2ce0 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -29,7 +29,7 @@ func (c *Config) handleFlagsConfig(appType AppType) error { var account MailAccount // shared flags - c.flagSet.BoolVar(&c.ShowHelp, HelpFlagShort, defaultHelp, helpFlagHelp+" (shorthand)") + c.flagSet.BoolVar(&c.ShowHelp, HelpFlagShort, defaultHelp, helpFlagHelp+shorthandFlagSuffix) c.flagSet.BoolVar(&c.ShowHelp, HelpFlagLong, defaultHelp, helpFlagHelp) c.flagSet.BoolVar(&c.ShowVersion, "version", defaultDisplayVersionAndExit, versionFlagHelp)