aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pw/pw.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r--usr.sbin/pw/pw.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index 063553dd084f..fc17f6dba022 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -101,13 +101,16 @@ static int (*cmdfunc[W_NUM][M_NUM])(int argc, char **argv, char *_name) = {
struct pwconf conf;
+static int mode = -1;
+static int which = -1;
+
static int getindex(const char *words[], const char *word);
static void cmdhelp(int mode, int which);
int
main(int argc, char *argv[])
{
- int mode = -1, which = -1, tmp;
+ int tmp;
struct stat st;
char arg, *arg1;
bool relocated, nis;
@@ -375,5 +378,11 @@ cmdhelp(int mode, int which)
fprintf(stderr, "%s", help[which][mode]);
}
- exit(EXIT_FAILURE);
+ exit(EX_USAGE);
+}
+
+void
+usage(void)
+{
+ cmdhelp(mode, which);
}