Skip to content

docs bug: unclear how to use env property for non-boolean arguments #46

@ORESoftware

Description

@ORESoftware

Say we have this:

  {
    names: ['json'],
    type: 'bool',
    env: 'nlu_setting_json'
  },

it's clear that if we use:

export nlu_setting_json=1

but what if we have an array of string or something:

  {
    names: ['search-root', 'search'],
    type: 'arrayOfString',
    help: 'Path to use to begin searching for relevant NPM packages; overrides config. ' +
    'To add multiple search-root\'s, use "--search-root x --search-root y".'
  },

it's unclear to me how to use an env variable for that.

On another note, I don't see why

export nlu_setting_json=false

and this

export nlu_setting_json=0

are not equivalent, when it comes to dashdash converting them to booleans. 0 and false are both strings, so why does dashdash not interpret "false" as false, but it does interpret "0" as false?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions