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

Long options with arguments don't accept arguments #175

Open
miltieIV2 opened this issue Oct 23, 2015 · 1 comment
Open

Long options with arguments don't accept arguments #175

miltieIV2 opened this issue Oct 23, 2015 · 1 comment

Comments

@miltieIV2
Copy link

$ tlsdate --host=xxx
./tlsdate: option '--host' doesn't allow an argument

The problem is that the field has_arg field in the array of struct options long_options is 0 (no_argument), but should be 1 (required_argument) for --host, --port, --protocol --certcontainer, and --proxy.

The short form flags work because they use the optstring (-H google.com works).

@miltieIV2
Copy link
Author

Not able to push a branch to do a pull request:
remote: Permission to ioerror/tlsdate.git denied to miltieIV2.
fatal: unable to access 'https://github.com/ioerror/tlsdate.git/': The requested URL returned error: 403

Patch:

diff --git a/src/tlsdate.c b/src/tlsdate.c
index dd7f993..4f8b1ae 100644
--- a/src/tlsdate.c
+++ b/src/tlsdate.c
@@ -138,14 +138,14 @@ main (int argc, char **argv)
         {"showtime", 2, 0, 'V'},
         {"skip-verification", 0, 0, 's'},
         {"help", 0, 0, 'h'},
-        {"host", 0, 0, 'H'},
-        {"port", 0, 0, 'p'},
-        {"protocol", 0, 0, 'P'},
+        {"host", 1, 0, 'H'},
+        {"port", 1, 0, 'p'},
+        {"protocol", 1, 0, 'P'},
         {"dont-set-clock", 0, 0, 'n'},
-        {"certcontainer", 0, 0, 'C'},
+        {"certcontainer", 1, 0, 'C'},
         {"timewarp", 0, 0, 't'},
         {"leap", 0, 0, 'l'},
-        {"proxy", 0, 0, 'x'},
+        {"proxy", 1, 0, 'x'},
         {"http", 0, 0, 'w'},
         {0, 0, 0, 0}
       };

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

1 participant