Skip to content

Commit 906ecde

Browse files
committed
fix: alphabetical ordering for constants, struct fields, and flags
1 parent ebd44b3 commit 906ecde

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
)
2323

2424
// Environment Variable constants
25+
const slackAccessibleEnv = "ACCESSIBLE"
2526
const slackAutoRequestAAAEnv = "SLACK_AUTO_REQUEST_AAA"
2627
const slackConfigDirEnv = "SLACK_CONFIG_DIR"
2728
const slackDisableTelemetryEnv = "SLACK_DISABLE_TELEMETRY"
28-
const slackAccessibleEnv = "ACCESSIBLE"
2929
const slackTestTraceEnv = "SLACK_TEST_TRACE"
3030

3131
type Config struct {
@@ -52,6 +52,7 @@ type Config struct {
5252
DisableTelemetryFlag bool
5353
ForceFlag bool
5454
LogstashHostResolved string
55+
NoColor bool
5556
RuntimeFlag string
5657
RuntimeName string
5758
RuntimeVersion string
@@ -60,7 +61,6 @@ type Config struct {
6061
SlackTestTraceFlag bool
6162
TeamFlag string
6263
TokenFlag string
63-
NoColor bool
6464

6565
// Feature experiments
6666
ExperimentsFlag []string

internal/config/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ func (c *Config) SetFlags(cmd *cobra.Command) {
3030

3131
// InitializeGlobalFlags configures flags and creates links from cmd to config
3232
func (c *Config) InitializeGlobalFlags(cmd *cobra.Command) {
33+
cmd.PersistentFlags().BoolVarP(&c.AccessibleFlag, "accessible", "", false, "use accessible prompts for screen readers")
3334
cmd.PersistentFlags().StringVar(&c.APIHostFlag, "apihost", "", "Slack API host")
3435
cmd.PersistentFlags().StringVarP(&c.AppFlag, "app", "a", "", "use a specific app ID or environment")
3536
cmd.PersistentFlags().StringVarP(&c.ConfigDirFlag, "config-dir", "", "", "use a custom path for system config directory")
3637
cmd.PersistentFlags().BoolVarP(&c.DeprecatedDevAppFlag, "local-run", "l", false, "use the local run app created by the `run` command") // deprecated
3738
cmd.PersistentFlags().BoolVarP(&c.DeprecatedDevFlag, "dev", "d", false, "use dev apis") // Can be removed after v0.25.0
38-
cmd.PersistentFlags().StringVarP(&c.DeprecatedWorkspaceFlag, "workspace", "", "", "select workspace or organization by domain name or team ID")
3939
cmd.PersistentFlags().StringSliceVarP(&c.ExperimentsFlag, "experiment", "e", nil, "use the experiment(s) in the command")
40-
cmd.PersistentFlags().BoolVarP(&c.AccessibleFlag, "accessible", "", false, "use accessible prompts for screen readers")
4140
cmd.PersistentFlags().BoolVarP(&c.ForceFlag, "force", "f", false, "ignore warnings and continue executing command")
4241
cmd.PersistentFlags().BoolVarP(&c.NoColor, "no-color", "", false, "remove styles and formatting from outputs")
42+
cmd.PersistentFlags().StringVarP(&c.RuntimeFlag, "runtime", "r", "", "the project's runtime language:\n deno (default), deno1.1, deno1.x, etc")
4343
cmd.PersistentFlags().BoolVarP(&c.SkipUpdateFlag, "skip-update", "s", false, "skip checking for latest version of CLI")
4444
cmd.PersistentFlags().BoolVarP(&c.SlackDevFlag, "slackdev", "", false, "shorthand for --apihost=https://dev.slack.com")
45-
cmd.PersistentFlags().StringVarP(&c.RuntimeFlag, "runtime", "r", "", "the project's runtime language:\n deno (default), deno1.1, deno1.x, etc")
4645
// TODO - next semver MAJOR can consider a new shorthand flag, right now -t and -T are used by other commands
4746
cmd.PersistentFlags().StringVarP(&c.TeamFlag, "team", "w", "", "select workspace or organization by team name or ID")
4847
cmd.PersistentFlags().StringVarP(&c.TokenFlag, "token", "", "", "set the access token associated with a team")
4948
cmd.PersistentFlags().BoolVarP(&c.DebugEnabled, "verbose", "v", false, "print debug logging and additional info")
49+
cmd.PersistentFlags().StringVarP(&c.DeprecatedWorkspaceFlag, "workspace", "", "", "select workspace or organization by domain name or team ID")
5050

5151
cmd.PersistentFlags().Lookup("apihost").Hidden = true
5252
cmd.PersistentFlags().Lookup("dev").Hidden = true

0 commit comments

Comments
 (0)