Skip to content

Fix long option followed by single dash#17

Merged
ljharb merged 1 commit intomainfrom
feature/single-dash-fix
Feb 9, 2023
Merged

Fix long option followed by single dash#17
ljharb merged 1 commit intomainfrom
feature/single-dash-fix

Conversation

@shadowspawn
Copy link
Copy Markdown
Member

A single dash is used with some utilities to represent stdin/stdout, as an argument or as an option value. Minimist was allowing a single dash as a space-separated value for a short option but not for a long option.

Fixes #15

This PR uses the same pattern for checking a potential long-option value as already being used for checking the short-option value. In particular, this means a single dash is now accepted as an option value when used like:

util --foo -

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

This is great!

Comment thread index.js
Comment thread test/dash.js Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 9, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.75%. Comparing base (ba92fe6) to head (9ec4d27).
Report is 44 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files           1        1           
  Lines         161      161           
  Branches       71       71           
=======================================
  Hits          159      159           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread test/dash.js
@ljharb ljharb force-pushed the feature/single-dash-fix branch from 36dc85d to 9ec4d27 Compare February 9, 2023 06:52
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.

- can not be string value

4 participants