summaryrefslogtreecommitdiff
path: root/src/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync.c')
-rw-r--r--src/sync.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/sync.c b/src/sync.c
index 045b820c2..04e99d800 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -18,6 +18,7 @@
/* Written by Jim Meyering */
#include <config.h>
+#include <getopt.h>
#include <stdio.h>
#include <sys/types.h>
@@ -66,16 +67,10 @@ main (int argc, char **argv)
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION,
usage, AUTHORS, (char const *) NULL);
+ if (getopt (argc, argv, "") != -1)
+ usage (EXIT_FAILURE);
- /* The above handles --help and --version.
- Since there is no other invocation of getopt, handle `--' here. */
- if (1 < argc && STREQ (argv[1], "--"))
- {
- --argc;
- ++argv;
- }
-
- if (1 < argc)
+ if (optind < argc)
error (0, 0, _("ignoring all arguments"));
sync ();