Skip to content

Conversation

DannyBen
Copy link
Member

@DannyBen DannyBen commented Dec 19, 2023

As raised in #461.

This PR adds the ability to use an array for the default value, when using repeatable for both arg and flag:

name: cli
help: Sample application
version: 0.1.0

args:
- name: file
  repeatable: true # must be true, otherwise default array is not allowed
  unique: true
  help: Specify file
  allowed:
  - spaced file
  - other-file
  default:  # <== NEW: allow using an array here
  - spaced file
  - other-file

flags:
- long: --path
  short: -p
  repeatable: true # must be true, otherwise default array is not allowed
  unique: true
  arg: location
  allowed:
  - spaced file
  - other-file
  default:  # <== NEW: allow using an array here
  - spaced file
  - other-file

@DannyBen DannyBen merged commit f45b993 into master Dec 19, 2023
@DannyBen DannyBen deleted the add/default-array-support branch December 19, 2023 14:20
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.

1 participant