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

Doesn't work with sile. #20

Closed
augustebaum opened this issue Mar 21, 2023 · 2 comments
Closed

Doesn't work with sile. #20

augustebaum opened this issue Mar 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@augustebaum
Copy link

augustebaum commented Mar 21, 2023

Describe the bug

Argument --help is not detected for the sile typesetter.

❯ halp sile
(°ロ°)  checking 'sile -v'
\(^ヮ^)/ success '-v' argument found!
SILE v0.14.8 (Lua 5.4)
(°ロ°)  checking 'sile -h'
(×﹏×)      fail '-h' argument not found.
(°ロ°)  checking 'sile --help'
(×﹏×)      fail '--help' argument not found.
(°ロ°)  checking 'sile help'
(×﹏×)      fail 'help' argument not found.
(°ロ°)  checking 'sile -H'
(×﹏×)      fail '-H' argument not found.

❯ sile --help
Usage: sile [OPTIONS] [--] [INPUT]

ARGUMENTS: ...

To reproduce

  1. Install sile v0.14.8 (Lua 5.4).
  2. Run the above commands.

Expected behavior

--help argument should be found.

Screenshots / Logs

Software information

  • Operating system: MacOS x86_64 12.4
  • Rust version: rustc 1.68.0 (2c8cc3432 2023-03-06)
  • Project version: 0.1.4

Additional context

Awesome project BTW, installed it 30 minutes ago and already using it a lot!

@orhun
Copy link
Owner

orhun commented Mar 24, 2023

Hello, thanks for the report! 🐻

It is because sile --help exits with the code 130 and halp accepts code 0 as success.

$ sile --help
...

$ echo $?
130

130 means:

command terminated due to Ctrl-C being pressed, 130-128=2 (SIGINT)

It seems weird and I don't know why they do that.

I created the following upstream issue: sile-typesetter/sile#1736

@alerque
Copy link

alerque commented Mar 25, 2023

Upstream SILE maintainer here. This will be fixed in the next patch release, v0.14.9, when it comes up. An oversight in the way Lua's cliargs module worked left us parsing --help both as a trigger for help and an error as if it was a failed parse. This probably affect many/most Lua apps that happen to use that argument parsing library. At this point upstream isn't very receptive to contributions, most projects will have to parse around that oddity themselves. Thanks for the report.

This issue can probably be closed since it isn't an error on the part of halp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants