You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently trying to implement a CLI that accepts different repeated arguments. The problem is that we need to add checks that the lengths of a subset of repeated parameters should be the same.
So for example CLI sends different messages to different recipients:
# is okay
cli send --recipient ALICE --content "hi!" --recipient BOB --content "goodbye"# results in error as no second recipient is presented
cli send --recipient ALICE --content "hi!" --content "goodbye"
But recipients.len() < contents.len() is okay:
cli send --recipient ALICE --recipient BOB --content "hi!"
Just the same content will be sent to different recipients. So contents became vec!["hi!"; recipients.len()] in this case.
Describe the solution you'd like
Developing additional functionality to ArgGroup could fix that, but I have no context about its current implementation.
Alternatives, if applicable
I believe that #1704 will fix the first case of the requested feature. Which, with some additional tweaks, can fulfill my needs with second case too
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Please complete the following tasks
Clap Version
4.3.23
Describe your use case
Currently trying to implement a CLI that accepts different repeated arguments. The problem is that we need to add checks that the lengths of a subset of repeated parameters should be the same.
recipients.len()
<contents.len()
is okay:cli send --recipient ALICE --recipient BOB --content "hi!"
Just the same content will be sent to different recipients. So
contents
becamevec!["hi!"; recipients.len()]
in this case.Describe the solution you'd like
Developing additional functionality to
ArgGroup
could fix that, but I have no context about its current implementation.Alternatives, if applicable
I believe that #1704 will fix the first case of the requested feature. Which, with some additional tweaks, can fulfill my needs with second case too
Additional Context
No response
The text was updated successfully, but these errors were encountered: