Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments broken #102

Closed
tenox7 opened this issue Nov 16, 2023 · 22 comments · Fixed by #103
Closed

arguments broken #102

tenox7 opened this issue Nov 16, 2023 · 22 comments · Fixed by #103

Comments

@tenox7
Copy link
Owner

tenox7 commented Nov 16, 2023

paging @MIvanchev #90 broke aruments/flags (update: for bsd/macos only), can you please fix?

@edgar-bonet
Copy link
Collaborator

I cannot reproduce:

$ git switch master
Already on 'master'
Your branch is up to date with 'upstream/master'.
$ git pull upstream
Already up to date.
$ git clean -dxf  # make this as clean as it gets
Removing ttyplot
$ make
cc -Wall -Wextra    ttyplot.c  `pkg-config --libs ncurses 2>/dev/null || echo '-lcurses -ltinfo'` -o ttyplot
$ ./ttyplot -v
ttyplot 1.5.1
$ ./ttyplot -h
Usage:
  ttyplot [-h] [-v] [-2] [-r] [-c plotchar] [-s scale] [-m max] [-M min] [-t title] [-u unit]

  -2 read two values and draw two plots, the second one is in reverse video
  [snip]
$ seq 1 80 | ./ttyplot -c o
# A plot is displayed with the ‘o’ character.
$ lsb_release -ds
Ubuntu 22.04.3 LTS

@MIvanchev
Copy link
Contributor

MIvanchev commented Nov 16, 2023

I can't reproduce either,

git checkout 1.5.1
rm ttyplot && make
seq 1 80 | ./ttyplot -c o -m 40 -t "I ain't scared of no ghosts." -u ghosts

Works great!

@hartwork
Copy link
Collaborator

@tenox7 can you define broken and share more about the environment? E.g. is it a box with ancient broken getopt by any chance?

@MIvanchev
Copy link
Contributor

It could be that optind needs to be reset to 1 instead of 0.

@MIvanchev
Copy link
Contributor

@tenox7 (and everyone else): Could you check if this MR works for you? If yes, I also incremented the version numbers for a hotfix release.

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

haha, no the issue is on latest freebsd and macos; build from head master and ran with -2, still only shows one chart, -c and others do not work

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

tried https://github.com/MIvanchev/ttyplot/tree/issue-102-potentially-incorrect-usage still same issue, both freebsd and macos

@MIvanchev
Copy link
Contributor

@tenox7 OK, I know what the issue is, stand by.

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

thank you :)

@MIvanchev
Copy link
Contributor

@tenox7 Try now? I've added some BSD and Mac logic.

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

checking (thank you!)

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

same repo? just did git clone https://github.com/MIvanchev/ttyplot.git && cd ttyplot && make ttyplot && ./ttyplot -2

linux: works
freebsd: doesnt
macos: doesnt

@MIvanchev
Copy link
Contributor

MIvanchev commented Nov 16, 2023

git clone --branch issue-102-potentially-incorrect-usage https://github.com/MIvanchev/ttyplot.git && cd ttyplot && make ttyplot && ./ttyplot -2

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

wait I guess I forgot to switch the branch

@tenox7
Copy link
Owner Author

tenox7 commented Nov 16, 2023

ok branch remotes/origin/issue-102-potentially-incorrect-usage works!

linux: works
macos: works
freebsd: works

thank you! please send a PR

@MIvanchev
Copy link
Contributor

MIvanchev commented Nov 16, 2023

It's here #103, good thing you test on non Linuxes :))

P.S.
I'll research how to set automated tests for that.

P.S.S.
Versions numbers are adjusted for 1.5.2 if you decide to hotfix immediately.

@tenox7
Copy link
Owner Author

tenox7 commented Nov 17, 2023

thank you for fixing @MIvanchev much appreciated!!!!

@MIvanchev
Copy link
Contributor

NP, this is a small one, much more work to be done.

@hartwork
Copy link
Collaborator

hartwork commented Nov 17, 2023

FYI pull request Homebrew/homebrew-core#154651 by @Porkepix will get 1.5.2 with the fix into homebrew for macOS. OpenBSD with current 1.5.1 is also affected. Is anyone in touch with them on the topic already?

@hartwork
Copy link
Collaborator

@fcambus any chance you could bump ttyplot to 1.5.2 to fix issue #102 (comment) for users of OpenBSD?

@fcambus
Copy link

fcambus commented Nov 17, 2023

@fcambus any chance you could bump ttyplot to 1.5.2 to fix issue #102 (comment) for users of OpenBSD?

I just committed an update, thanks for the heads-up!

@hartwork
Copy link
Collaborator

@fcambus excellent, thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants