From nobody Thu Jan 23 08:01:53 2025 X-Original-To: dev-commits-src-all@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 4Ydth15KmPz5lp10; Thu, 23 Jan 2025 08:01:53 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydth14gp0z3fCN; Thu, 23 Jan 2025 08:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737619313; 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=PQ65zFx+BlCrtbfcmE8EWFnHAGrPonFhTCM4N/LYeTM=; b=AMDrCf12dSkiEWVkR/03BVZlTJXyQtOj+GHJ4WMImhuu7aHeGUgMan23bW67Xi/pR1LRmb 2lzOw4mhq29VeJ/OBNFniv+m46AOrCA/Q+s+3jRV6BYbbbAHQQwFRJf8g97aZcLPvQqoNH AiLCHp1hHfxBBd5nkl8NkpMln4bGbCmD59kWGM7NaAheoL1mXSHbAhLexNAXQiWCPSSKjD +9CsSe5yWpJZfMHH6zUylxOOFW2qWle/7OpbLGBLrMyBZFBB/cKi4B8PF8qHzQAU1jsurR mfjeXAZhToUpMA1P69Lvp0vMWuc3F2lz3Wj5WkaYpjls9YDvRT6oCsUeRBptAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737619313; 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=PQ65zFx+BlCrtbfcmE8EWFnHAGrPonFhTCM4N/LYeTM=; b=GyiEuR7OMKoHR1QTAOQJHyQFLctN8zCiI0f8PwAu4oxnArw5d7vGBzvzZMLgZMkJQA80dv VU2UFH7Is7vnyOR5esfpiWpPMqutpuga1n2PkitueYjpyZ5gGlSy4O0XQHyIVZ6NDBkk5t GUIICl9xLdbqZPcP8/53u+24osiNmmndv41RmGqJlBdfgvCCLqgmGnef53LBQnEcMXUUIz 8PYkov4riRuT92wZl5LZJmrarvPPdYd0mPcHMK5dAx8wZYQuOw/tn7FVySVUgQFk1N2EZ3 Tp3ygxGYUSHEOcX8barDoWFwgWf0VVTnPhutjKS/IP9LLnTBC5SjzitEaMgS9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737619313; a=rsa-sha256; cv=none; b=i2EXw6q+ptR8CJ+PgJbyuAhms1RL1XrC7m4vC65q8tW/4VTWD14U1u0FqqtbiNN4lDHcbe Rbl2a8OTIa3r09w4liIWYPBHEdnPsLSgaGH9Vv6Euk6WVdXoNEZRwS3l1VlEC62gD2bfzU ku//eaQwPjUVJrZ2SXjH3CBRIOnfApGGTmZULdJqYQLF/IT35S0x1SLyTMn5dqU8csRVGP Sa46zRozAdROscr9fZ3BJRUdZDq7Kce6fWkCim8Y8gppIrria1BWYhKU5wSF1L577OQmnP 43F+14qrhqqTYUXo/XQ3pzj3XSIpPdZFeSnvIrifXWvwL5gaun7xFpQTJ/XIhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Ydth14Gl1zDW0; Thu, 23 Jan 2025 08:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50N81rLp067097; Thu, 23 Jan 2025 08:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50N81reA067094; Thu, 23 Jan 2025 08:01:53 GMT (envelope-from git) Date: Thu, 23 Jan 2025 08:01:53 GMT Message-Id: <202501230801.50N81reA067094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: c294ecb25b5f - main - sysctl: Sort options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c294ecb25b5f3553b5c84b630869bb05724c9629 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c294ecb25b5f3553b5c84b630869bb05724c9629 commit c294ecb25b5f3553b5c84b630869bb05724c9629 Author: Zhenlei Huang AuthorDate: 2025-01-23 08:01:04 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-23 08:01:04 +0000 sysctl: Sort options No functional change intended. MFC after: 1 day --- sbin/sysctl/sysctl.8 | 16 ++++++++-------- sbin/sysctl/sysctl.c | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 8cffb180ca67..b6a06e2c3bab 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -68,10 +68,6 @@ opaque or excluded from listing via the flag. This option is ignored if one or more variable names are specified on the command line. -.It Fl b -Force the value of the variable(s) to be output in raw, binary format. -No names are printed and no terminating newlines are output. -This is mostly useful with a single variable. .It Fl B Ar bufsize Set the buffer size to read from the .Nm @@ -81,6 +77,10 @@ This is necessary for a .Nm that has variable length, and the probe value of 0 is a valid length, such as .Va kern.arandom . +.It Fl b +Force the value of the variable(s) to be output in raw, binary format. +No names are printed and no terminating newlines are output. +This is mostly useful with a single variable. .It Fl d Print the description of the variable instead of its value. .It Fl e @@ -94,15 +94,15 @@ This option is ignored if either or .Fl n is specified, or a variable is being set. +.It Fl F +Print the format of the variable. +This is additional information to describe the type of the variable and +most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl f Ar filename Specify a file which contains a pair of name and value in each line. .Nm reads and processes the specified file first and then processes the name and value pairs in the command line argument. -.It Fl F -Print the format of the variable. -This is additional information to describe the type of the variable and -most useful with struct types such as clockinfo, timeval, and loadavg. .It Fl h Format output for human, rather than machine, readability. .It Fl i diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index ef5d0508e5c3..d3a3c64057d3 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -136,7 +136,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:FhiJlNnoqtTVwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AaB:bdeFf:hiJlNnoqTtVWwXx")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -145,24 +145,24 @@ main(int argc, char **argv) case 'a': aflag = 1; break; - case 'b': - bflag = 1; - break; case 'B': Bflag = strtol(optarg, NULL, 0); break; + case 'b': + bflag = 1; + break; case 'd': dflag = 1; break; case 'e': eflag = 1; break; - case 'f': - conffile = optarg; - break; case 'F': Fflag = true; break; + case 'f': + conffile = optarg; + break; case 'h': hflag = 1; break; @@ -187,22 +187,22 @@ main(int argc, char **argv) case 'q': qflag = 1; break; - case 't': - tflag = 1; - break; case 'T': Tflag = 1; break; + case 't': + tflag = 1; + break; case 'V': Vflag = true; break; + case 'W': + Wflag = 1; + break; case 'w': /* compatibility */ /* ignored */ break; - case 'W': - Wflag = 1; - break; case 'X': /* compatibility */ aflag = xflag = 1;