minimistjs / minimist

parse argument options
MIT License
530 stars 30 forks source link

Fix long option followed by single dash #17

Closed shadowspawn closed 1 year ago

shadowspawn commented 1 year ago

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 -
codecov-commenter commented 1 year ago

Codecov Report

Merging #17 (9ec4d27) into main (ba92fe6) will not change coverage. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   98.75%   98.75%           
=======================================
  Files           1        1           
  Lines         161      161           
  Branches       71       71           
=======================================
  Hits          159      159           
  Misses          2        2           
Impacted Files Coverage Δ
index.js 98.75% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.