Skip to content

Add single string parsing - #186

Merged
henryiii merged 2 commits into
CLIUtils:masterfrom
phlptp:single_string_parse
Jan 6, 2019
Merged

henryiii merged 2 commits into
CLIUtils:masterfrom
phlptp:single_string_parse

Conversation

@phlptp

@phlptp phlptp commented Jan 5, 2019

Copy link
Copy Markdown
Collaborator

If merged this pull request will add a function to parse a single string containing all the arguments and optionally the program name. The function splits the single string into a vector and then uses the existing parse function. Basically a wrapper around the split function to deal with the program name and some edge cases that can arise when everything is in the same string.

The PR also includes test code for the functionality and
a modification of the split_up function to handle backquote '`' characters and quoted strings

…string.

add the ability to deal with a single string in the parse command and handle quoted string appropriately
@phlptp

phlptp commented Jan 5, 2019

Copy link
Copy Markdown
Collaborator Author

I didn't see any place in the readme where it would be appropriate to add a discussion of the function. So I didn't do anything regarding that or in the What's new file. I can add something if you would like.

@codecov

codecov Bot commented Jan 5, 2019

Copy link
Copy Markdown

Codecov Report

Merging #186 into master will decrease coverage by 0.05%.
The diff coverage is 96.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
- Coverage     100%   99.94%   -0.06%     
==========================================
  Files          12       12              
  Lines        1818     1841      +23     
==========================================
+ Hits         1818     1840      +22     
- Misses          0        1       +1
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/StringTools.hpp 99.12% <80%> (-0.88%) ⬇️

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 3a2c511...e5857dd. Read the comment docs.

@codecov

codecov Bot commented Jan 5, 2019 •

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #186   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        1818   1849   +31     
=====================================
+ Hits         1818   1849   +31
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/StringTools.hpp 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 3a2c511...cdb585f. Read the comment docs.

@henryiii

henryiii commented Jan 6, 2019

Copy link
Copy Markdown
Collaborator

I have a few minor consistency changes in mind, but I'll go ahead and merge, then make them. I'll add at least a note in the change log.

@henryiii
henryiii merged commit 30c2e32 into CLIUtils:master Jan 6, 2019
henryiii added a commit that referenced this pull request Jan 6, 2019
@henryiii

henryiii commented Jan 6, 2019

Copy link
Copy Markdown
Collaborator

One suggestion: Most of the contents of the parse(string function can be moved to a helper function that is not part of App. This makes it easier to write unit tests for, since you have string in, vector of strings out, and keeps the already long App.hpp from growing too much.

@phlptp
phlptp deleted the single_string_parse branch January 6, 2019 15:30
@henryiii henryiii added this to the v1.7 milestone Feb 9, 2019
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