mkvserver_mk2 icon indicating copy to clipboard operation
mkvserver_mk2 copied to clipboard

Attempts to add command line argument parsing with getopt_long.

Open Yetoo1 opened this issue 5 years ago • 1 comments

This commit attempts to add command line options -a -h -p -r -u and adds help documentation. This was using getopt_long. The url can be customized with -r, -a, and -p (address, protocol, and port respectively) with -u overriding the aformentioned options if submitted alongside and allowing to specify a url string with appropriate components concatenated in a single string. The following is the help text and gives more description: usage: server [-ahpru] [file] The default generated url is http://0:8080 A url can be customized by providing the address (-a), port (-p), or protocol (-r). A url can be entered in full with the -u option. -a, --address Specify an address to use in url (default 0) -h, --help Print this help message -p, --port Specify a port to use in url (default 8080) -r, --protocol Specify a protocol to use in url (default http) -u, --url Specify a url with the following format. (protocol://address:port). If other options are used with -u, -u will override the other options.

Issues:

  1. The protocol on a generated or supplied url gives a Failed to open server: Protocol not found and it looks like there is healthy output, but testing download looks like the request isn't being registered. I've found that if a literal string is substituted for the url string, this issue doesn't happen, but if the string is generated or delivered from a char* or const char* the error occurrs.
  2. Input from redirection and/or pipe may not be correctly handled (it wasn't correctly handled in the latest commit in master).

Yetoo1 avatar Aug 20 '19 07:08 Yetoo1

Any help and/or suggestions would be appreciated to resolve both issues with this commit.

Yetoo1 avatar Aug 20 '19 07:08 Yetoo1