From nobody Mon Mar 18 13:59:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TyxKm1LRfz5Dn7n; Mon, 18 Mar 2024 13:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TyxKl6Jnlz4MgF; Mon, 18 Mar 2024 13:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710770347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K2x07U038KgoHPH/A39l+gdV0Y/yfCeysAk80E7fnVA=; b=WNSoo4s2tbr6EArrF3afVFLVPC3yqOS0aeLvXm+gXmCvHLUuefCO3/quITuWb8Whqc2IAj S8IRLFdjDbFnwHZNq61RYRxnqS396Q9l/X6lEUhTRozUfmk+JOTrMWKJJrp/e23I4VGypy Y/k6VdnmZ/gEg03vv/GKCjd+T1gHMpIeeDzB5zARInVvFBPcXJWhhpP11Q45/TbA7h0Yir k9N8MGaS4nmWk4lDoVyKB7VCzl3MEb7MNzEXAVZ7E6gW9+Al80EEirPGyalQINcyvSYNNd ITcBiuoYtrAakeRB8RyY5g3sav/S/a6qee89hOAXhm+HKO9s+S1zzGDKHKg/4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710770347; a=rsa-sha256; cv=none; b=ymYMp19fUEj1THPR4oolqfm/3Ia8odOKtKdFJRTTtk2r0m+OjCsG9JuiI8F070+6sYVVPJ BYwi0KimHsqjRk1GZ0pZhcr83G9ufNVEfn8l/CcKi+v2Mn8arLV1mbzLx1bIs/tfSb1wIo LSUUSwCjjRMuctWW6vsHkJHvld6SMLH0HK4mkIG9G40xUt6Nw2Zj1zaVqQgNdPO1Wtyk7B DkszFUcfllE9irZwTe5v45XX+0M6229nQQh2KNse0J1JscRQGg6ieXsjH+lP1cVK3ROl7Y iPe1lteUyXU1UaKcLO8ocWjMGUy8iZ0ApRYWYFoNDfHGWt40v9WaqTqbjViq6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710770347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K2x07U038KgoHPH/A39l+gdV0Y/yfCeysAk80E7fnVA=; b=uraKbmhyzbPAwJuJ5LR2gP3FoxTsZeXvzqn+MGBQyPrhyTV8TEH2noaBrCymIZsG5QmCSs TILrJq1K+Sog7F523AIUy6gpfHsu+hi4uRf2Af9C5itqlEk1BXHgz9YV0MZSc4YTOSdI7I TlODVnruJh+KiThDoa545WwmV8ogWUgHvcyqMsXU8VpCuc4ZPW/kJzbnceQSwoYYtK8Sll mbZBsgzJLDllsIt5wErFbAfsuSEM0E1hCjktlNY/tFRQ3ZCLc2Kaw57Be35sWDclMRlmpz 0GjBRsa7ctfYOTVYefliCYBn+2AP+Vd69Ee9xJl3zSks+bXY1YEp5atI7CTHFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TyxKl5wHczQZ8; Mon, 18 Mar 2024 13:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42IDx7Ue098284; Mon, 18 Mar 2024 13:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42IDx7N2098281; Mon, 18 Mar 2024 13:59:07 GMT (envelope-from git) Date: Mon, 18 Mar 2024 13:59:07 GMT Message-Id: <202403181359.42IDx7N2098281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a46217ce7d16 - main - bectl: Simplify command aliases. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a46217ce7d161ce563374899df4d94b6d000138f Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a46217ce7d161ce563374899df4d94b6d000138f commit a46217ce7d161ce563374899df4d94b6d000138f Author: Dag-Erling Smørgrav AuthorDate: 2024-03-18 13:49:23 +0000 Commit: Dag-Erling Smørgrav 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));