Re:Parsing command line arguments using a finite state machi...
by jpdarago on Thursday January 29, 2015 @12:40PM
(#8967639)
For that I think you can do something similar to what mpc for C (https://github.com/orangeduck/mpc) and LPeg for Lua (http://www.inf.puc-rio.br/~roberto/lpeg/), which is to provide the parsing machinery and write a small DSL with the same machinery for the users.
Contrast how it is done now:
With a parser combinator based approach: And this didn't even handle the fact that options order is not important.