summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/add
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>1998-04-07 04:06:38 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>1998-04-07 04:06:38 +0000
commit38defaccee7309efb4cb43c18cbe752e81fe0837 (patch)
treeb21d10ed376abff8faa13125bbf722fff2b6273b /usr.sbin/pkg_install/add
parent407cb528206651b367e51fffd7bca5e8eb3e5d7c (diff)
fix check for no command line args
Diffstat (limited to 'usr.sbin/pkg_install/add')
-rw-r--r--usr.sbin/pkg_install/add/main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c
index 020917c7e17..23be7e12e81 100644
--- a/usr.sbin/pkg_install/add/main.c
+++ b/usr.sbin/pkg_install/add/main.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: main.c,v 1.4 1998/04/04 22:44:13 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.5 1998/04/07 04:06:37 marc Exp $ */
#ifndef lint
-static char *rcsid = "$OpenBSD: main.c,v 1.4 1998/04/04 22:44:13 deraadt Exp $";
+static char *rcsid = "$OpenBSD: main.c,v 1.5 1998/04/07 04:06:37 marc Exp $";
#endif
/*
@@ -130,12 +130,13 @@ main(int argc, char **argv)
}
}
}
+ /* If no packages, yelp */
+ if (!ch)
+ usage(prog_name, "Missing package name(s)");
+ else if (ch > 1 && AddMode == MASTER)
+ usage(prog_name,
+ "Only one package name may be specified with master mode");
}
- /* If no packages, yelp */
- else if (!ch)
- usage(prog_name, "Missing package name(s)");
- else if (ch > 1 && AddMode == MASTER)
- usage(prog_name, "Only one package name may be specified with master mode");
if ((err = pkg_perform(pkgs)) != NULL) {
if (Verbose)
fprintf(stderr, "%d package addition(s) failed.\n", err);