Space separated arguments

Hello, I've created a custom messagePreParse that allows spaces as separators and it ended up parsing options and flags way faster than default while still providing me the info I needed.
After testing and finally feeling comfortable with it, I continued exploring Sapphire and added the subcommands package, quickly realizing they weren't compatible, as Subcommand's PreParseReturn only accepts types that extend from Args and mine would return a different (simpler) kind of object. So I've been dealing with this for a few days and I'm trying to figure out what would be the optimal approach as Lexure doesn't support spaces as a separator for options (I think?). A properly formatted command would look like: !command some leading content -opt1 value -flag1 --opt2 "value 2" My custom parser also supported spaces in values but I guess this is not possible with Lexure, eg: !command some leading content -opt1 the value -flag1 -opt2 another value -flag2 trailing content And it would parse the contents according to the options/flags that were provided to it. Is there a way to allow this kind of syntax (1st example) that wouldn't require THAT much effort, as I've already spent way too much time in the custom argument parser that now I have to discard.
4 Replies
Favna
Favna2mo ago
@kyra tbh
kyra
kyra2mo ago
:sweats: yeah that's a complicated thing
//
//OP2mo ago
Ah, sadge, I guess I'll continue to work my way around these limitations, maybe forking the Subcommand class to allow my parser
Want results from more Discord servers?
Add your server