From 1088f78e217d4750ed54ff6dd7b602203c920bdb Mon Sep 17 00:00:00 2001 From: lteo Date: Wed, 16 Jul 2014 04:52:43 +0000 Subject: [PATCH] Clean up the ifdef maze in usage() by reformatting it to have distinct !SMALL and SMALL sections. This makes future changes easier to review and to compare with the man page's synopsis. The usage output is the same as before so there is no change from the user's point of view. usage() cleanup and !SMALL/SMALL separation suggested by jmc@ ok jmc@ --- usr.bin/ftp/main.c | 64 ++++++++++------------------------------------ 1 file changed, 14 insertions(+), 50 deletions(-) diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 7631889a81e..83a020cdcf3 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.91 2014/07/14 09:26:27 jsing Exp $ */ +/* $OpenBSD: main.c,v 1.92 2014/07/16 04:52:43 lteo Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -867,61 +867,25 @@ help(int argc, char *argv[]) void usage(void) { - (void)fprintf(stderr, "usage: %s " + fprintf(stderr, "usage: " #ifndef SMALL - "[-46AadEegimnptVv] [-D title] [-k seconds] [-P port] " + "%1$s [-46AadEegimnptVv] [-D title] [-k seconds] [-P port] " "[-r seconds]\n" " [-s srcaddr] [host [port]]\n" - " %s [-C] " -#endif /* !SMALL */ - "[-o output] " -#ifndef SMALL - "[-s srcaddr]\n" - " " -#endif /* !SMALL */ - "ftp://[user:password@]host[:port]/file[/] ...\n" - " %s " -#ifndef SMALL - "[-C] [-c cookie] " -#endif /* !SMALL */ - "[-o output] " -#ifndef SMALL - "[-S ssl_options] " + " %1$s [-C] [-o output] [-s srcaddr]\n" + " ftp://[user:password@]host[:port]/file[/] ...\n" + " %1$s [-C] [-c cookie] [-o output] [-S ssl_options] " "[-s srcaddr]\n" " [-U useragent] " -#endif /* !SMALL */ - "http" -#ifndef SMALL - "[s]" -#endif - "://" -#ifndef SMALL - "[user:password@]" -#endif - "host[:port]/file ...\n" - " %s " -#ifndef SMALL - "[-C] " -#endif /* !SMALL */ - "[-o output] " -#ifndef SMALL - "[-s srcaddr] " -#endif /* !SMALL */ - "file:file ...\n" - " %s " -#ifndef SMALL - "[-C] " -#endif /* !SMALL */ - "[-o output] " -#ifndef SMALL - "[-s srcaddr] " -#endif /* !SMALL */ - "host:/file[/] ...\n", -#ifndef SMALL - __progname, __progname, __progname, __progname, __progname); + "http[s]://[user:password@]host[:port]/file ...\n" + " %1$s [-C] [-o output] [-s srcaddr] file:file ...\n" + " %1$s [-C] [-o output] [-s srcaddr] host:/file[/] ...\n", #else /* !SMALL */ - __progname, __progname, __progname, __progname); + "%1$s [-o output] ftp://[user:password@]host[:port]/file[/] ...\n" + " %1$s [-o output] http://host[:port]/file ...\n" + " %1$s [-o output] file:file ...\n" + " %1$s [-o output] host:/file[/] ...\n", #endif /* !SMALL */ + __progname); exit(1); } - -- 2.20.1