Luminarys / synapse

Synapse BitTorrent Daemon
https://synapse-bt.org
ISC License
853 stars 48 forks source link

sycli: improved filter syntax #185

Closed evanrichter closed 4 years ago

evanrichter commented 4 years ago

this is my first try at #180, and everything seems to be working well!

The only thing I'm not sure of is how you want to do error handling on clearly invalid strings like "peers>five". This would currently panic with the message "Invalid numeric value"

evanrichter commented 4 years ago

@Luminarys ok I think I addressed everything! At a high level, I'm using the regex crate now, building two regexes (one for string types and one for numeric), and now either can be quoted or unquoted, and just like before if nothing matches right, the string is put into a name: search. Also I added a delimiter :: for case-sensitive searches. : is still case insensitive

again, I'm glad to contribute and open to suggestions

Luminarys commented 4 years ago

Looks good now, thanks!