Skip to content

Simplify command option namesΒ #1220

Closed
Closed

Description

@fmbenhassine

Command options currently have multiple longNames and shortNames. This introduces unnecessary complexity with array handling in the code for no real added value as typical CLI options have a single short name and long name most of the time. Some examples:

>docker container commit --help
Usage:  docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]

Create a new image from a container's changes

Aliases:
  docker container commit, docker commit

Options:
  -a, --author string    Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
  -c, --change list      Apply Dockerfile instruction to the created image
  -m, --message string   Commit message
  -p, --pause            Pause container during commit (default true)
>gh auth login --help
USAGE
  gh auth login [flags]

FLAGS
  -c, --clipboard             Copy one-time OAuth device code to clipboard
  -p, --git-protocol string   The protocol to use for git operations on this host: {ssh|https}
  -h, --hostname string       The hostname of the GitHub instance to authenticate with
      --insecure-storage      Save authentication credentials in plain text instead of credential store
  -s, --scopes strings        Additional authentication scopes to request
      --skip-ssh-key          Skip generate/upload SSH key prompt
  -w, --web                   Open a browser to authenticate
      --with-token            Read token from standard input

Options might have multiple short/long names, but this is clearly not the most typical use case. I think Spring Shell should default to a single short/long name for command options and provide an extension point to handle multiple names (might be an extension/redesign of the current OptionNameModifier).

Activity

  1. changed the title [-]Improve command options names[/-] [+]Simplify command option names[/+] on Nov 12, 2025
  2. added and removed
    status/need-triageTeam needs to triage and take a first look
    on Nov 12, 2025
  3. added this to the 4.0.0-M2 milestone on Nov 12, 2025
  4. fmbenhassine commented on Nov 12, 2025

    @fmbenhassine
    ContributorAuthor

    Resolved in 7199ea4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions