--- old/usr/src/cmd/beadm/beadm.c	Wed Jul 18 21:07:51 2012
+++ new/usr/src/cmd/beadm/beadm.c	Wed Jul 18 21:07:51 2012
@@ -123,21 +123,21 @@
 	    "\n"
 	    "\tsubcommands:\n"
 	    "\n"
-	    "\tbeadm activate beName\n"
-	    "\tbeadm create [-d BE_desc]\n"
+	    "\tbeadm activate [-v] beName\n"
+	    "\tbeadm create [-a] [-d BE_desc]\n"
 	    "\t\t[-o property=value] ... [-p zpool] \n"
-	    "\t\t[-e nonActiveBe | beName@snapshot] beName\n"
+	    "\t\t[-e nonActiveBe | beName@snapshot] [-v] beName\n"
 	    "\tbeadm create [-d BE_desc]\n"
-	    "\t\t[-o property=value] ... [-p zpool] beName@snapshot\n"
-	    "\tbeadm destroy [-Ffs] beName \n"
-	    "\tbeadm destroy [-F] beName@snapshot \n"
-	    "\tbeadm list [[-a] | [-d] [-s]] [-H] [beName]\n"
-	    "\tbeadm mount [-s ro|rw] beName [mountpoint]\n"
-	    "\tbeadm unmount [-f] beName | mountpoint\n"
-	    "\tbeadm umount [-f] beName | mountpoint\n"
-	    "\tbeadm rename origBeName newBeName\n"
-	    "\tbeadm rollback beName snapshot\n"
-	    "\tbeadm rollback beName@snapshot\n"));
+	    "\t\t[-o property=value] ... [-p zpool] [-v] beName@snapshot\n"
+	    "\tbeadm destroy [-Ffsv] beName \n"
+	    "\tbeadm destroy [-Fv] beName@snapshot \n"
+	    "\tbeadm list [[-a] | [-d] [-s]] [-H] [-v] [beName]\n"
+	    "\tbeadm mount [-s ro|rw] [-v] beName [mountpoint]\n"
+	    "\tbeadm unmount [-fv] beName | mountpoint\n"
+	    "\tbeadm umount [-fv] beName | mountpoint\n"
+	    "\tbeadm rename [-v] origBeName newBeName\n"
+	    "\tbeadm rollback [-v] beName snapshot\n"
+	    "\tbeadm rollback [-v] beName@snapshot\n"));
 }
 
 static int
@@ -664,8 +664,20 @@
 {
 	nvlist_t	*be_attrs;
 	int		err = 1;
+	int		c;
 	char		*obe_name;
 
+	while ((c = getopt(argc, argv, "v")) != -1) {
+		switch (c) {
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
+		default:
+			usage();
+			return (1);
+		}
+	}
+
 	argc -= optind;
 	argv += optind;
 
@@ -728,7 +740,7 @@
 	char		*propval = NULL;
 	char		*strval = NULL;
 
-	while ((c = getopt(argc, argv, "ad:e:io:p:")) != -1) {
+	while ((c = getopt(argc, argv, "ad:e:io:p:v")) != -1) {
 		switch (c) {
 		case 'a':
 			activate = B_TRUE;
@@ -766,6 +778,9 @@
 		case 'p':
 			nbe_zpool = optarg;
 			break;
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
 		default:
 			usage();
 			goto out2;
@@ -939,7 +954,7 @@
 	char		*snap_name;
 	char		*be_name;
 
-	while ((c = getopt(argc, argv, "fFs")) != -1) {
+	while ((c = getopt(argc, argv, "fFsv")) != -1) {
 		switch (c) {
 		case 'f':
 			destroy_flags |= BE_DESTROY_FLAG_FORCE_UNMOUNT;
@@ -947,6 +962,9 @@
 		case 's':
 			destroy_flags |= BE_DESTROY_FLAG_SNAPSHOTS;
 			break;
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
 		case 'F':
 			suppress_prompt = B_TRUE;
 			break;
@@ -1061,7 +1079,7 @@
 	int		c = 0;
 	char		*be_name = NULL;
 
-	while ((c = getopt(argc, argv, "nadsH")) != -1) {
+	while ((c = getopt(argc, argv, "adsvH")) != -1) {
 		switch (c) {
 		case 'a':
 			all = B_TRUE;
@@ -1072,6 +1090,9 @@
 		case 's':
 			snaps = B_TRUE;
 			break;
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
 		case 'H':
 			parsable = B_TRUE;
 			break;
@@ -1145,7 +1166,7 @@
 	char		*mountpoint;
 	char		*tmp_mp = NULL;
 
-	while ((c = getopt(argc, argv, "s:")) != -1) {
+	while ((c = getopt(argc, argv, "s:v")) != -1) {
 		switch (c) {
 		case 's':
 			shared_fs = B_TRUE;
@@ -1162,6 +1183,9 @@
 			}
 
 			break;
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
 		default:
 			usage();
 			return (1);
@@ -1223,7 +1247,6 @@
 		(void) printf(_("Mounted successfully on: '%s'\n"), mountpoint);
 		break;
 	case BE_ERR_BE_NOENT:
-		err = 1;
 		(void) fprintf(stderr, _("%s does not exist or appear "
 		    "to be a valid BE.\nPlease check that the name of "
 		    "the BE provided is correct.\n"), obe_name);
@@ -1235,13 +1258,11 @@
 		break;
 	case BE_ERR_PERM:
 	case BE_ERR_ACCESS:
-		err = 1;
 		(void) fprintf(stderr, _("Unable to mount %s.\n"), obe_name);
 		(void) fprintf(stderr, _("You have insufficient privileges to "
 		    "execute this command.\n"));
 		break;
 	default:
-		err = 1;
 		(void) fprintf(stderr, _("Unable to mount %s.\n"), obe_name);
 		(void) fprintf(stderr, "%s\n", be_err_to_str(err));
 	}
@@ -1262,11 +1283,14 @@
 	int		c;
 	int		unmount_flags = 0;
 
-	while ((c = getopt(argc, argv, "f")) != -1) {
+	while ((c = getopt(argc, argv, "fv")) != -1) {
 		switch (c) {
 		case 'f':
 			unmount_flags |= BE_UNMOUNT_FLAG_FORCE;
 			break;
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
 		default:
 			usage();
 			return (1);
@@ -1337,7 +1361,19 @@
 	char		*obe_name;
 	char		*nbe_name;
 	int err = 1;
+	int c;
 
+	while ((c = getopt(argc, argv, "v")) != -1) {
+		switch (c) {
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
+		default:
+			usage();
+			return (1);
+		}
+	}
+
 	argc -= optind;
 	argv += optind;
 
@@ -1394,7 +1430,19 @@
 	char		*obe_name;
 	char		*snap_name;
 	int		err = 1;
+	int		c;
 
+	while ((c = getopt(argc, argv, "v")) != -1) {
+		switch (c) {
+		case 'v':
+			libbe_print_errors(B_TRUE);
+			break;
+		default:
+			usage();
+			return (1);
+		}
+	}
+
 	argc -= optind;
 	argv += optind;
 
