daniele77 / cli

A library for interactive command line interfaces in modern C++
Boost Software License 1.0
1.23k stars 140 forks source link

command parser allows unclosed quoted strings (in the example complete.cpp) #195

Open yurivict opened 1 year ago

yurivict commented 1 year ago

For example, the first 3 of these queries are processed incorrectly:

cli> add 1 2 "3
1 + 2 + 3 = 6
cli> add 1 2 '3
1 + 2 + 3 = 6
cli> add 1 2 '''3
1 + 2 + 3 = 6
cli> add 1 2 1'''3
wrong command: add 1 2 1'''3
cli> 

Version: 2.0.2 FreeBSD 13.1

daniele77 commented 1 year ago

Yes, currently it treats an unclosed quoted string as closed at the end of the line. Actually, it can be considered a feature. The alternative would be outputting a "wrong command" error, but I don't think it would be really a better behavior.