Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Parsing command parameters

Hello everyone, is there currently an API script (or a library of sorts) for parsing parameters in a command in a predictable way? If not (which I believe) wouldn't it be an idea to get together to work on such a thing? I'm thinking of taking getopt or getopt_long as a reference if you know your GNU tools. I think that such an lib could help lots of script authors to not reinvent the wheel. Just an idea.
1538996443
The Aaron
Pro
API Scripter
Most scripts have pretty simple command structures which don’t require more than  let cmds = msg.content.split(/\s+/); Or let cmds = msg.content.split(/--\s+/); I’d not be opposed to helping write something, I’ve had some ideas about combining argument parsing, help generation, and some other utilities, but haven’t ever actually done it   That said, I’m pretty sure Brian S. translated getopts into a script which is in the repo.