Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

fix: default should be T[] when multiple: true #56

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

quantumkid
Copy link
Contributor

When using the multiple: true option in a flag the default option should be an array.

For example:

  static flags = {
    foo: flags.string({
      char: 'f',
      description: 'test flag',
      multiple: true,
      default: ['a']
    }),
    bar: flags.integer({
      char: 'b',
      description: 'test flag two',
      multiple: true,
      default: [1, 2, 3]
    })
  }

In this way the type of default matches the type of the flag itself.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @quantumkid to sign the Salesforce.com Contributor License Agreement.

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #56 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #56   +/-   ##
=======================================
  Coverage   91.35%   91.35%           
=======================================
  Files          11       11           
  Lines         324      324           
  Branches       85       85           
=======================================
  Hits          296      296           
  Misses         12       12           
  Partials       16       16
Impacted Files Coverage Δ
src/flags.ts 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3111afb...255f7d9. Read the comment docs.

Copy link
Contributor

@RasPhilCo RasPhilCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏄 good catch!

@RasPhilCo RasPhilCo merged commit bab7447 into oclif:master Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants