Skip to content

Support CommandWithArguments hint for options #3266

@tmccombs

Description

@tmccombs

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Clap Version

3.0.5

Describe your use case

I have an argument like:

            Arg::new("exec-batch")
                .long("exec-batch")
                .short('X')
                .min_values(1)
                .allow_hyphen_values(true)
                .value_terminator(";")
                .value_name("cmd")

Ideally, I would be able to use .value_hint(ValueHint::CommandWithArguments) for this, but since it isn't a positional argument, I can't.

Describe the solution you'd like

Allow using ValueHint::CommandWithArguments for non-positional arguments, as long as:

  1. It accepts multiple values
  2. there is a value_terminator supplied

Alternatives, if applicable

possibly have a seperate hint type for this use case?

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-completionArea: completion generatorC-enhancementCategory: Raise on the bar on expectationsS-triageStatus: New; needs maintainer attention.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions