Skip to content

Conversation

@spkane31
Copy link
Contributor

What was changed

The flags help text does not wrap within the column, making it more difficult to read. If the flag description spills over a line it will start from the left instead of where the previous line started.
Current behavior:

Flags:
      --color string                                      Output coloring. Accepted values: always, never, auto. (default "auto")
      --command-timeout duration                          The command execution timeout. 0s means no timeout. (default 0s)
      --config-file $CONFIG_PATH/temporal/temporal.toml   File path to read TOML config from, defaults to $CONFIG_PATH/temporal/temporal.toml where `$CONFIG_PATH` is defined as `$HOME/
.config` on Unix, "$HOME/Library/Application Support" on macOS, and %AppData% on Windows. EXPERIMENTAL.
      --disable-config-env                                If set, disables loading environment config from environment variables. EXPERIMENTAL.
      --disable-config-file                               If set, disables loading environment config from config file. EXPERIMENTAL.
      --env ENV                                           Active environment name (ENV). (default "default")
      --env-file $HOME/.config/temporalio/temporal.yaml   Path to environment settings file. Defaults to $HOME/.config/temporalio/temporal.yaml.
  -h, --help                                              help for temporal
      --log-format string                                 Log format. Accepted values: text, json. (default "text")
      --log-level server start-dev                        Log level. Default is "info" for most commands and "warn" for server start-dev. Accepted values: debug, info, warn, error, nev
er. (default "info")
      --no-json-shorthand-payloads                        Raw payload output, even if the JSON option was used.
  -o, --output string                                     Non-logging data output format. Accepted values: text, json, jsonl, none. (default "text")
      --profile string                                    Profile to use for config file. EXPERIMENTAL.
      --time-format string                                Time format. Accepted values: relative, iso, raw. (default "relative")
  -v, --version                                           version for temporal

New behavior:

Flags:
      --client-connect-timeout duration                   The client connection timeout. 0s means no timeout. (default 0s)
      --color string                                      Output coloring. Accepted values: always, never, auto. (default "auto")
      --command-timeout duration                          The command execution timeout. 0s means no timeout. (default 0s)
      --config-file $CONFIG_PATH/temporal/temporal.toml   File path to read TOML config from, defaults to $CONFIG_PATH/temporal/temporal.toml where `$CONFIG_PATH` is defined as
                                                          `$HOME/.config` on Unix, "$HOME/Library/Application Support" on macOS, and %AppData% on Windows. EXPERIMENTAL.
      --disable-config-env                                If set, disables loading environment config from environment variables. EXPERIMENTAL.
      --disable-config-file                               If set, disables loading environment config from config file. EXPERIMENTAL.
      --env ENV                                           Active environment name (ENV). (default "default")
      --env-file $HOME/.config/temporalio/temporal.yaml   Path to environment settings file. Defaults to $HOME/.config/temporalio/temporal.yaml.
  -h, --help                                              help for temporal
      --log-format string                                 Log format. Accepted values: text, json. (default "text")
      --log-level server start-dev                        Log level. Default is "info" for most commands and "warn" for server start-dev. Accepted values: debug, info, warn,
                                                          error, never. (default "info")
      --no-json-shorthand-payloads                        Raw payload output, even if the JSON option was used.
  -o, --output string                                     Non-logging data output format. Accepted values: text, json, jsonl, none. (default "text")
      --profile string                                    Profile to use for config file. EXPERIMENTAL.
      --time-format string                                Time format. Accepted values: relative, iso, raw. (default "relative")
  -v, --version                                           version for temporal

Why?

Better readability

Checklist

  1. Closes NA

  2. How was this tested:
    Tested manually

  3. Any docs updates needed?
    No

@spkane31 spkane31 requested review from a team as code owners October 10, 2025 15:11
}
}

// getUsageTemplate returns a custom usage template with proper flag wrapping
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link to where the original template came from so we can keep it up to date with new Cobra releases.

@spkane31 spkane31 merged commit 8239c23 into main Oct 13, 2025
8 checks passed
@spkane31 spkane31 deleted the spk/wrapped-flags branch October 13, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants