github-markdown-toc icon indicating copy to clipboard operation
github-markdown-toc copied to clipboard

Better argument parsing

Open ixs opened this issue 2 years ago • 0 comments

Currently gh-md-toc will only do a limited job parsing arguments.

e.g. gh-md-toc --insert --hide-footer --skip-header README.md would fail as only the --insert option would be parsed as an option and the --hide-footer option would be considered the filename.

This PR adds a new parser in a loop that will parse all arguments instead.

The parser is inspired by https://stackoverflow.com/a/14203146, which solves the problem nicely.

ixs avatar Nov 15 '23 06:11 ixs