summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tftp/main.c53
-rw-r--r--usr.bin/tftp/tftp.16
2 files changed, 21 insertions, 38 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index cbfdb07666f..9c32e68ec41 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.44 2022/10/04 07:03:27 kn Exp $ */
+/* $OpenBSD: main.c,v 1.45 2022/10/04 08:03:26 kn Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -109,23 +109,6 @@ int opt_tsize = 0;
int opt_tout = 0;
int opt_blksize = 0;
-char vhelp[] = "toggle verbose mode";
-char thelp[] = "toggle packet tracing";
-char chelp[] = "connect to remote tftp";
-char qhelp[] = "exit tftp";
-char hhelp[] = "print help information";
-char shelp[] = "send file";
-char rhelp[] = "receive file";
-char mhelp[] = "set file transfer mode";
-char sthelp[] = "show current status";
-char xhelp[] = "set per-packet retransmission timeout";
-char ihelp[] = "set total retransmission timeout";
-char ashelp[] = "set mode to netascii";
-char bnhelp[] = "set mode to octet";
-char oshelp[] = "toggle tsize option";
-char othelp[] = "toggle timeout option";
-char obhelp[] = "set alternative blksize option";
-
struct cmd {
char *name;
char *help;
@@ -133,23 +116,23 @@ struct cmd {
};
struct cmd cmdtab[] = {
- { "connect", chelp, parsearg },
- { "mode", mhelp, modecmd },
- { "put", shelp, put },
- { "get", rhelp, get },
- { "quit", qhelp, quit },
- { "verbose", vhelp, setverbose },
- { "trace", thelp, settrace },
- { "status", sthelp, status },
- { "binary", bnhelp, setbinary },
- { "ascii", ashelp, setascii },
- { "rexmt", xhelp, setrexmt },
- { "timeout", ihelp, settimeout },
- { "tsize", oshelp, settsize },
- { "tout", othelp, settout },
- { "blksize", obhelp, setblksize },
- { "help", hhelp, help },
- { "?", hhelp, help },
+ { "?", "print help information", help },
+ { "ascii", "set mode to netascii", setascii },
+ { "binary", "set mode to octet", setbinary },
+ { "blksize", "set alternative blksize option", setblksize },
+ { "connect", "connect to remote tftp", parsearg },
+ { "get", "receive file", get },
+ { "help", "print help information", help },
+ { "mode", "set file transfer mode", modecmd },
+ { "put", "send file", put },
+ { "quit", "exit tftp", quit },
+ { "rexmt", "set per-packet retransmission timeout", setrexmt },
+ { "status", "show current status", status },
+ { "timeout", "set total retransmission timeout", settimeout },
+ { "tout", "toggle timeout option", settout },
+ { "trace", "toggle packet tracing", settrace },
+ { "tsize", "toggle tsize option", settsize },
+ { "verbose", "toggle verbose mode", setverbose },
{ NULL, NULL, NULL }
};
diff --git a/usr.bin/tftp/tftp.1 b/usr.bin/tftp/tftp.1
index 0a9704ea8d0..88289e312ed 100644
--- a/usr.bin/tftp/tftp.1
+++ b/usr.bin/tftp/tftp.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tftp.1,v 1.20 2012/05/01 04:23:21 gsoares Exp $
+.\" $OpenBSD: tftp.1,v 1.21 2022/10/04 08:03:26 kn Exp $
.\" $NetBSD: tftp.1,v 1.5 1995/08/18 14:45:44 pk Exp $
.\"
.\" Copyright (c) 1990, 1993, 1994
@@ -30,7 +30,7 @@
.\"
.\" @(#)tftp.1 8.2 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: May 1 2012 $
+.Dd $Mdocdate: October 4 2022 $
.Dt TFTP 1
.Os
.Sh NAME
@@ -62,7 +62,7 @@ is running, it issues the prompt
and recognizes the following commands:
.Pp
.Bl -tag -width verbose -compact
-.It Ic \&? Ar command-name ...
+.It Ic \&? Ns | Ns Ic help Op Ar command ...
Print help information.
.Pp
.It Ic ascii