version 1.8, 2019/02/12 14:00:57 |
version 1.9, 2019/02/12 14:09:59 |
|
|
struct option lopts[] = { |
struct option lopts[] = { |
{ "delete", no_argument, &opts.del, 1 }, |
{ "delete", no_argument, &opts.del, 1 }, |
{ "rsync-path", required_argument, NULL, 1 }, |
{ "rsync-path", required_argument, NULL, 1 }, |
|
{ "rsh", required_argument, NULL, 'e' }, |
{ "sender", no_argument, &opts.sender, 1 }, |
{ "sender", no_argument, &opts.sender, 1 }, |
{ "server", no_argument, &opts.server, 1 }, |
{ "server", no_argument, &opts.server, 1 }, |
{ "verbose", no_argument, &opts.verbose, 1 }, |
{ "verbose", no_argument, &opts.verbose, 1 }, |
|
|
while ((c = getopt_long(argc, argv, "e:lnprtv", lopts, NULL)) != -1) { |
while ((c = getopt_long(argc, argv, "e:lnprtv", lopts, NULL)) != -1) { |
switch (c) { |
switch (c) { |
case 'e': |
case 'e': |
|
opts.ssh_prog = optarg; |
/* Ignore. */ |
/* Ignore. */ |
break; |
break; |
case 'l': |
case 'l': |
|
|
return c ? EXIT_SUCCESS : EXIT_FAILURE; |
return c ? EXIT_SUCCESS : EXIT_FAILURE; |
usage: |
usage: |
fprintf(stderr, "usage: %s [-lnprtv] " |
fprintf(stderr, "usage: %s [-lnprtv] " |
"[--delete] [--rsync-path=prog] src ... dst\n", |
"[-e ssh-prog] [--delete] [--rsync-path=prog] src ... dst\n", |
getprogname()); |
getprogname()); |
return EXIT_FAILURE; |
return EXIT_FAILURE; |
} |
} |