ivanceras / svgbob

Convert your ascii diagram scribbles into happy little SVG
http://ivanceras.github.io/svgbob-editor/
Apache License 2.0
3.91k stars 112 forks source link

New flag to handle inline string parsing #17

Closed yhql closed 7 years ago

yhql commented 7 years ago

Should fix issue 15 (tested on Windows and linux)

ivanceras commented 7 years ago

I think this is OK

ivanceras commented 7 years ago

This needs more refinement. You can not just do

echo "+--+\n| |\n+--+" | svgbob -s
yhql commented 7 years ago

It should still work just like before if you remove the -s flag. I made the modification so that you can still do : echo "+--+\n| |\n+--+" | svgbob and for the cases where you don't want to use echo : svgbob -s "+--+\n| |\n+--+"

ivanceras commented 7 years ago

Ah ok, got it. However there is an inconsistency though. This works fine. svgbob -s "+--+\n| |\n+--+"

but not

svgbob -s "hello"

neither svgbob -s "----------+-----------"

This works though svgbob -s "||||||"

I'm guessing there is a conflict with subcommands with the clap library.

yhql commented 7 years ago

Ah yes it seems clap is parsing the command in an unexpected way, but as it suggests in some case, you can do this : svgbob -s -- "hello" which works fine for me

ivanceras commented 7 years ago

Ok, I've changed the Readme and I will release a new svgbob_cli into crates.io shortly.