Skip to content

feat: add new options#2

Merged
ivodolenc merged 1 commit intomainfrom
feat/new-options
Sep 10, 2024
Merged

feat: add new options#2
ivodolenc merged 1 commit intomainfrom
feat/new-options

Conversation

@ivodolenc
Copy link
Copy Markdown
Member

Type of Change

  • New feature
  • Documentation
  • Tests

Request Description

New Options

defaults

Specifies an object of defaults that will be added to the parsed output regardless of CLI inputs.

  • Type: (Record<string, unknown> & { _?: string[] }) | undefined
  • Default: undefined
import { createArgs } from '@hypernym/args'

createArgs({
  defaults: {
    _: ['value'],
    a: true,
  },
})

exclude

Specifies an array of values that will be skipped when parsing arguments.

  • Type: string[] | undefined
  • Default: undefined
import { createArgs } from '@hypernym/args'

createArgs({
  exclude: ['arg', '--flag', '-alias'],
})

Supports the ability to add values ​​using the = sign

$ --flag=value

# => { _: [], flag: 'value', }
$ -alias=value

# => { _: [], alias: 'value', }

Additional Details

  • Improves performance
  • Improves types and examples
  • Adds tests

@ivodolenc ivodolenc added the feat New feature label Sep 10, 2024
@ivodolenc ivodolenc merged commit 398763f into main Sep 10, 2024
@ivodolenc ivodolenc deleted the feat/new-options branch September 10, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant