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

Command line configuration is ignored #10

Open
JeromeA opened this issue Mar 16, 2025 · 3 comments
Open

Command line configuration is ignored #10

JeromeA opened this issue Mar 16, 2025 · 3 comments

Comments

@JeromeA
Copy link

JeromeA commented Mar 16, 2025

Folders set from the command line, using the -d and -b options, are ignored.

This is due to configStr being initialised to "{}", and later being used to override the command line with empty values.

Moreover, sendDirContents() uses a fallback, so it actually sends the current directory when this happens, but that fallback doesn't exist when serving a file, so when the user selects one of the files, the server just shows an error message.

@hffqyd
Copy link
Owner

hffqyd commented Mar 19, 2025

Folders set from the command line, using the -d and -b options, are ignored.

I've just tested using command liketw5server -d:/path/to/ -b:test, it worked as expected. Could you give an example command that you used?

@JeromeA
Copy link
Author

JeromeA commented Mar 19, 2025

Ah, you are right, I didn't pay attention to the unusual syntax used for options.

A solution to avoid my mistake would be to output an error when an argument is not an option, so that tw5server -d /full/path would fail on the last argument?

@hffqyd
Copy link
Owner

hffqyd commented Mar 20, 2025

Ok, it could be considered in the next version. Thanks for your suggestion.

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

No branches or pull requests

2 participants