Skip to content

Algernon flags precedence issue #145

Open
@Dialga

Description

@Dialga

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions