tenox7 / ttyplot

a realtime plotting utility for terminal/console with data input from stdin
Apache License 2.0
1.13k stars 47 forks source link

[1.5.2] `ttyplot -c X -2` fails to use ASCII character "X" for drawing? #113

Closed hartwork closed 9 months ago

hartwork commented 10 months ago

Hi!

I ran into something by accident that to me looks like there could be more issues with the command line parsing than just #102 that was fixed by #103 recently. This is what I found:

# git rev-parse HEAD
07ce2f904f0a24ab46c0af170fa65cbb3bfe62bb

# uname -s
Linux

# make

# ./ttyplot -2 -c X <<<'1 2'  # good, draws using the "X" character as expected

# ./ttyplot -c X -2 <<<'1 2'  # bad, draws using default pipe ("|") character, no error reported

Do you get the same? Am I using it wrong?

Thanks, Sebastian

edgar-bonet commented 10 months ago

I do get the same. ttyplot forcibly sets plotchar to the ASCII pipe when the option -2 is provided. Not sure why, but this behavior is here since the initial commit.

hartwork commented 10 months ago

@edgar-bonet okay wow! I think just dropping that line will be a good fix today. Pull request coming…