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

--help flag exits with code 1 #1736

Closed
orhun opened this issue Mar 24, 2023 · 4 comments · Fixed by #1737
Closed

--help flag exits with code 1 #1736

orhun opened this issue Mar 24, 2023 · 4 comments · Fixed by #1737
Milestone

Comments

@orhun
Copy link

orhun commented Mar 24, 2023

Hello! 🐻

I'm the author of an open source tool called halp and it is basically responsible for checking the exit codes of common command-line arguments.

Recently one of the users reported that halp cannot discover the --help option of sile: orhun/halp#20

I'm not sure if it is on purpose but it is because sile --help returns with code 1 130 which is CTRL-C / SIGINT.

$ sile --help
...

$ echo $?
1

I'm not fluent in lua so it would take some time for me to dive into the codebase and find the exact place where this happens. Thus I thought it would be best to create an issue and ask about this :3

@alerque alerque added this to the v0.14.9 milestone Mar 24, 2023
@alerque
Copy link
Member

alerque commented Mar 24, 2023

Thanks for reporting this back upstream. (Ve İzmir'den selamlar.)

I'm not able to replicate the 130 exit code. I get 1, which is also arguably wrong but seems to be hard coded into the argument parser library we used when handling help. I can probably fix that, but that doesn't explain the 130 business.

What do you have for sile --version?

@orhun
Copy link
Author

orhun commented Mar 24, 2023

Thanks for reporting this back upstream. (Ve İzmir'den selamlar.)

Ankara'dan selam olsun 👋🏼

I'm not able to replicate the 130 exit code. I get 1, which is also arguably wrong but seems to be hard coded into the argument parser library we used when handling help. I can probably fix that, but that doesn't explain the 130 business.

It is weird, I just got 1 as well. I was executing in a chroot before which should affect anything normally but maybe there was some quirks happened in my terminal, don't really know. I will update the issue.

Nevertheless, I think it should return 0 instead. It would be so great if you can fix it! :3

What do you have for sile --version?

SILE v0.14.8 (Lua 5.4)

@orhun orhun changed the title --help flag exits with code 130 --help flag exits with code 1 Mar 24, 2023
@alerque
Copy link
Member

alerque commented Mar 24, 2023

I have a fix for 1 to be 0. I can't replicate 130 anywhere (Arch, Nix, Ubuntu, Docker, under Lua, LuaJIT, OpenResty, etc.) so unless anybody can replicate that I'm going to ignore. The 0 return for explicitly calling --help should be in the next release.

@orhun
Copy link
Author

orhun commented Mar 24, 2023

Thank you so much!

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.

2 participants