summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qacp.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/qacp.c b/qacp.c
index f441e07..cf76652 100644
--- a/qacp.c
+++ b/qacp.c
@@ -67,13 +67,9 @@ lprintf(int priority, const char *format, ...)
void
usage()
{
-/* printf("usage: qacp: [-r] [[user@]host1:]file1 [...] " */
- /* "[[user@]host2:]file2\n"); */
-
- /* For now, only simple cmdlines */
- fprintf(stderr, "usage:\n\t%s\n\t%s\n",
- "qacp <localpath> [<loacalpath> ...] [user@]host:<rmtpath>",
- "qacp [user@]host:<rmtpath> [[user@]host:<rmtpath> ...] <localpath> ");
+ fprintf(stderr, "usage:\n" \
+ "\tqacp [-q] <localpath> [<loacalpath> ...] [user@]host:<rmtpath>\n"
+ "\tqacp [-q] [user@]host:<rmtpath> [[user@]host:<rmtpath> ...] <localpath>\n");
}
@@ -361,7 +357,7 @@ qacp_recvonefile(const char *host, const char *srcfile, const char *destfile)
int
-recvfiles(char **argv, int argc, int fileidx, short recursive)
+recvfiles(char **argv, int argc, int fileidx)
{
char *cp;
char *rhost = NULL;
@@ -528,7 +524,7 @@ error_free_destpath:
int
-sendfiles(char **argv, int argc, int fileidx, short recursive)
+sendfiles(char **argv, int argc, int fileidx)
{
char *cp;
char *rhost = NULL;
@@ -653,22 +649,16 @@ int
main(int argc, char *argv[])
{
int c;
- short recursive=0;
int eflag;
- while ((c = getopt(argc, argv, "+rq")) != -1) {
+ while ((c = getopt(argc, argv, "+qh")) != -1) {
switch (c) {
- case 'r':
- fprintf(stderr, "-r not supported\n");
- exit(2);
- recursive = 1;
- break;
case 'q':
quiet = 1;
break;
case '?':
+ case 'h':
default:
- printf("Unknown option %c\n", (char)optopt);
usage();
exit(1);
}
@@ -682,11 +672,11 @@ main(int argc, char *argv[])
eflag = 0;
/* If last arg has a ':' then we are sending files */
if (strchr(argv[argc-1], ':') != NULL) {
- if (sendfiles(argv, argc, optind, recursive) < 0) {
+ if (sendfiles(argv, argc, optind) < 0) {
eflag++;
}
} else {
- if (recvfiles(argv, argc, optind, recursive) < 0) {
+ if (recvfiles(argv, argc, optind) < 0) {
eflag++;
}
}