summaryrefslogtreecommitdiffstats
path: root/usr.bin/ftp/main.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-10-23 16:48:59 +0000
committerderaadt <deraadt@openbsd.org>2019-10-23 16:48:59 +0000
commit5200472308ca2f43d51ff3189adfa64b19e2c44f (patch)
treedd0ac6912496cd4d9b618d1836dec07997d28638 /usr.bin/ftp/main.c
parentadapt to new ftp(1) retrieving error messages (diff)
downloadwireguard-openbsd-5200472308ca2f43d51ff3189adfa64b19e2c44f.tar.xz
wireguard-openbsd-5200472308ca2f43d51ff3189adfa64b19e2c44f.zip
Add new -N name option, so that calling scripts can change the
progname and produce better error messages discussed with aja and jca
Diffstat (limited to 'usr.bin/ftp/main.c')
-rw-r--r--usr.bin/ftp/main.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 822dab3b382..5f32501f161 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.129 2019/05/16 12:44:18 florian Exp $ */
+/* $OpenBSD: main.c,v 1.130 2019/10/23 16:48:59 deraadt Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -297,7 +297,7 @@ main(volatile int argc, char *argv[])
httpuseragent = NULL;
while ((ch = getopt(argc, argv,
- "46AaCc:dD:Eegik:Mmno:pP:r:S:s:tU:vVw:")) != -1) {
+ "46AaCc:dD:EeN:gik:Mmno:pP:r:S:s:tU:vVw:")) != -1) {
switch (ch) {
case '4':
family = PF_INET;
@@ -310,6 +310,9 @@ main(volatile int argc, char *argv[])
passivemode = 0;
break;
+ case 'N':
+ setprogname(optarg);
+ break;
case 'a':
anonftp = 1;
break;
@@ -943,25 +946,25 @@ usage(void)
"ftp [-46AadEegiMmnptVv] [-D title] [-k seconds] [-P port] "
"[-r seconds]\n"
" [-s srcaddr] [host [port]]\n"
- " ftp [-C] [-o output] [-s srcaddr]\n"
+ " ftp [-C] [-N name] [-o output] [-s srcaddr]\n"
" ftp://[user:password@]host[:port]/file[/] ...\n"
- " ftp [-C] [-c cookie] [-o output] [-S ssl_options] "
+ " ftp [-C] [-c cookie] [-N name] [-o output] [-S ssl_options] "
"[-s srcaddr]\n"
" [-U useragent] [-w seconds] "
"http[s]://[user:password@]host[:port]/file ...\n"
- " ftp [-C] [-o output] [-s srcaddr] file:file ...\n"
- " ftp [-C] [-o output] [-s srcaddr] host:/file[/] ...\n"
+ " ftp [-C] [-N name] [-o output] [-s srcaddr] file:file ...\n"
+ " ftp [-C] [-N name] [-o output] [-s srcaddr] host:/file[/] ...\n"
#else /* !SMALL */
- "ftp [-o output] "
+ "ftp [-N name] [-o output] "
"ftp://[user:password@]host[:port]/file[/] ...\n"
#ifndef NOSSL
- " ftp [-o output] [-S ssl_options] [-w seconds] "
+ " ftp [-N name] [-o output] [-S ssl_options] [-w seconds] "
"http[s]://[user:password@]host[:port]/file ...\n"
#else
- " ftp [-o output] [-w seconds] http://host[:port]/file ...\n"
+ " ftp [-N name] [-o output] [-w seconds] http://host[:port]/file ...\n"
#endif /* NOSSL */
- " ftp [-o output] file:file ...\n"
- " ftp [-o output] host:/file[/] ...\n"
+ " ftp [-N name] [-o output] file:file ...\n"
+ " ftp [-N name] [-o output] host:/file[/] ...\n"
#endif /* !SMALL */
);
exit(1);