Skip to content

Support empty arguments #31

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

Merged
merged 1 commit into from
Jan 13, 2020
Merged

Support empty arguments #31

merged 1 commit into from
Jan 13, 2020

Conversation

marckhouzam
Copy link
Contributor

Currently

Parse(`foo "" bar ''`)

ignores the empty parameters and gives ["foo","bar"]. This should not be the case since a shell will detect these empty arguments. Furthermore, according to #5 the current behaviour is not correct.

With this PR the Parse result becomes ["foo", "", "bar", ""] as described in #5 and as a shell would have interpreted.

@codecov-io
Copy link

codecov-io commented Jan 13, 2020

Codecov Report

Merging #31 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #31   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines         125    129    +4     
=====================================
+ Hits          125    129    +4
Impacted Files Coverage Δ
shellwords.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51d68c7...43e18de. Read the comment docs.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
@mattn
Copy link
Owner

mattn commented Jan 13, 2020

Thank you

@mattn mattn merged commit e75dab3 into mattn:master Jan 13, 2020
@marckhouzam marckhouzam deleted the fix/emptyArg branch January 13, 2020 19:11
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.

3 participants