Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2024 13:59:07 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a46217ce7d16 - main - bectl: Simplify command aliases.
Message-ID:  <202403181359.42IDx7N2098281@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=a46217ce7d161ce563374899df4d94b6d000138f

commit a46217ce7d161ce563374899df4d94b6d000138f
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-03-18 13:49:23 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-03-18 13:49:23 +0000

    bectl: Simplify command aliases.
    
    MFC after:      3 days
    Reviewed by:    kevans
    Differential Revision:  https://reviews.freebsd.org/D44406
---
 sbin/bectl/bectl.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c
index 68f3de5b7e78..f4359750a8d7 100644
--- a/sbin/bectl/bectl.c
+++ b/sbin/bectl/bectl.c
@@ -114,7 +114,9 @@ static struct command_map_entry command_map[] =
 	{ "mount",    bectl_cmd_mount,   false   },
 	{ "rename",   bectl_cmd_rename,  false   },
 	{ "unjail",   bectl_cmd_unjail,  false   },
+	{ "ujail",    bectl_cmd_unjail,  false   },
 	{ "unmount",  bectl_cmd_unmount, false   },
+	{ "umount",   bectl_cmd_unmount, false   },
 	{ "check",    bectl_cmd_check,   true    },
 };
 
@@ -570,13 +572,6 @@ main(int argc, char *argv[])
 	optreset = 1;
 	optind = 1;
 
-	/* Handle command aliases */
-	if (strcmp(command, "umount") == 0)
-		command = "unmount";
-
-	if (strcmp(command, "ujail") == 0)
-		command = "unjail";
-
 	if ((cmd = get_cmd_info(command)) == NULL) {
 		fprintf(stderr, "Unknown command: %s\n", command);
 		return (usage(false));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403181359.42IDx7N2098281>