Specify minimum required selected elements in interactiveMultiSelectList
It would be useful to be able to specify minimum required selected elements in Terminal.interactiveMultiSelectList().
If you're using it through Clikt, you can add a validate to the option to check the length of the list.
What would you want the behavior to be if the minimum was specified on the list?
What would you want the behavior to be if the minimum was specified on the list?
The user should not be able to complete the selection with [ENTER] unless at least the minimum number of elements are selected. Similar to that you can now specify the maximum allowed with limit.
If you're using it through Clikt, you can add a
validateto the option to check the length of the list.
I'm using Clikt in the same app, but I am not using interactiveMultiSelectList in a Clikt option, so I don't think that would work for me.
This is how I am using it (open source): https://gitlab.com/chromaway/core-tools/management-console/-/blob/386b25c39885d785eac4b0c309996c4e284d4232/src/main/kotlin/net/postchain/mc/cli/DCBaseCommand.kt#L96-99
(In this case I want to force the user to select exactly neededAdditionalKeys elements.)