Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cleanup bin #127

Merged
merged 1 commit into from
Jun 15, 2023
Merged

fix: cleanup bin #127

merged 1 commit into from
Jun 15, 2023

Conversation

lukekarrys
Copy link
Contributor

No description provided.

@lukekarrys lukekarrys requested a review from a team as a code owner June 14, 2023 00:29
@wraithgar
Copy link
Member

What makes this unused? Isn't this a breaking change?

@lukekarrys
Copy link
Contributor Author

Unused is the wrong word. It's just not useful. It has a hardcoded list of options and the only user input is process.argv. It looks like it was created to test nopt via the CLI, but was never for user consumption.

So technically it is a breaking change, but I'd rather leave it in than release a major for something that no on is using.

For example here's output when running it via npx:

❯ npx nopt --x=1 -nb --help
parsed {
  x: '1',
  bool: false,
  help: true,
  argv: {
    remain: [],
    cooked: [ '--x', '1', '--no-bool', '--help' ],
    original: [ '--x=1', '-nb', '--help' ]
  }
}

nopt cli tester

types
{
  num: 'Number',
  bool: 'Boolean',
  help: 'Boolean',
  list: 'Array',
  'num-list': [ 'Number', 'Array' ],
  'str-list': [ 'String', 'Array' ],
  'bool-list': [ 'Boolean', 'Array' ],
  str: 'String',
  clear: 'Boolean',
  config: 'Boolean',
  length: 'Number',
  file: undefined
}

shorthands
{
  s: [ '--str', 'astring' ],
  b: [ '--bool' ],
  nb: [ '--no-bool' ],
  tft: [ '--bool-list', '--no-bool-list', '--bool-list', 'true' ],
  '?': [ '--help' ],
  h: [ '--help' ],
  H: [ '--help' ],
  n: [ '--num', '125' ],
  c: [ '--config' ],
  l: [ '--length' ],
  f: [ '--file' ],
  ___singles: {
    s: true,
    b: true,
    '?': true,
    h: true,
    H: true,
    n: true,
    c: true,
    l: true,
    f: true
  }
}

@lukekarrys lukekarrys changed the title fix: remove unused bin fix: cleanup bin Jun 14, 2023
@lukekarrys lukekarrys force-pushed the lk/coverage branch 2 times, most recently from b2db2e7 to 015b33f Compare June 14, 2023 19:43
@lukekarrys
Copy link
Contributor Author

@wraithgar changed this to simplify the bin script and remove the nopt tester logging portion of it.

Base automatically changed from lk/coverage to main June 14, 2023 19:49
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.

2 participants