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

Algernon flags precedence issue #145

Open
Dialga opened this issue Dec 23, 2023 · 1 comment
Open

Algernon flags precedence issue #145

Dialga opened this issue Dec 23, 2023 · 1 comment
Assignees
Labels
bug This is a bug can-reproduce-the-issue Can reproduce the issue

Comments

@Dialga
Copy link

Dialga commented Dec 23, 2023

The help msg says:

Algernon 1.15.5

Web Server

Syntax:
  algernon [flags] [file or directory to serve] [host][:port]

Following the syntax when I try algernon -p . 127.0.0.1:8080 the program fails to start:

-------------------------------------------------
-> /etc/algernon/serverconf.lua
INFO[0000] Serving HTTP/2 on https://localhost/
INFO[0000] Serving HTTP on http://localhost/
ERRO[0000] open /etc/algernon/cert.pem: no such file or directory
FATA[0000] listen tcp :80: bind: permission denied

Yet if I move -p to the end it works, contrary to the help syntax:
algernon . 127.0.0.1:8080 -p

-------------------------------------------------
-> /etc/algernon/serverconf.lua
INFO[0000] Serving HTTP/2 on https://127.0.0.1:8080/
ERRO[0000] open cert.pem: no such file or directory. Not serving HTTP/2.
INFO[0000] Use the -t flag for serving regular HTTP.
INFO[0000] Serving HTTP on http://127.0.0.1:8080/
Ready
lua>

If this is a feature, please document that -p must be the last flag passed for it to work(or the conf file takes precedence over -p), if not please allow -p to be used as the first flag.
Other combinations I tried include algernon -x and algernon . localhost:3000 -x, the latter which show the lua repl whereas the former doesn't.

@xyproto
Copy link
Owner

xyproto commented Dec 23, 2023

Thanks for reporting! I'll look into the flag handling.

@xyproto xyproto added bug This is a bug planning-to-reproduce-the-issue Planning to reproduce the issue labels Dec 23, 2023
@xyproto xyproto self-assigned this Dec 23, 2023
@xyproto xyproto added can-reproduce-the-issue Can reproduce the issue and removed planning-to-reproduce-the-issue Planning to reproduce the issue labels Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug can-reproduce-the-issue Can reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants