spheredev / neosphere

A lightweight game engine and development platform using JavaScript for game coding, based on the original Sphere engine by Chad Austin but with a redesigned, modern API and brand-new command-line development tools.
http://www.spheredev.org/
Other
105 stars 15 forks source link

Rewrite the command-line parser #138

Open fatcerberus opened 7 years ago

fatcerberus commented 7 years ago

Command-line parsing code is currently duplicated (imperfectly) among the various programs in the Sphere toolchain. This has already caused inconsistencies and bugs to sneak up in the past, and will become increasingly unmaintainable as more tools get added. Come up with a generic command-line parsing framework that can be shared by all tools.

fatcerberus commented 7 years ago

I should probably use this opportunity to tighten up the syntax rules for command-line options. For example, it's currently possible to combine multiple single-letter abbreviations into one option even when more than one of those takes an argument. The arguments are then read left-to-right. Not only is that error-prone, but such a command line is potentially ambiguous to a reader. It should probably just be a syntax error.

fatcerberus commented 6 years ago

Placing this on the back burner as command line handling works well for the time being, it's just that the code is messy.