Automic VaultAutomic Vault

brew

使用 Homebrew, zypper, Nix 安装 gnu-getopt

查看 gnu-getopt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install gnu-getopt

local Homebrew formula metadata

Linux

openSUSE zypper已验证 · 92%
sudo zypper install gnu-getopt

openSUSE Tumbleweed package metadata · gnu-getopt · 来源: download.opensuse.org

Nix已验证 · 92%
nix profile install nixpkgs#getopt

nixpkgs package indexes · pkgs/by-name/ge/getopt/package.nix · 来源: api.github.com

概览

软件包摘要

Command-line option parsing utility

命令和别名

  • getopt

历史

项目历史与用法

`gnu-getopt` packages util-linux's enhanced `getopt(1)` command, a shell-facing option parser that uses GNU `getopt(3)` behavior and is commonly installed separately where the base system ships a less capable `getopt`.

项目历史

The upstream project is util-linux, described by its README as a collection of Linux utilities. util-linux carried the name util-linux-ng from 2006 through 2010, then continued under the util-linux name with kernel.org as the primary source location and GitHub as a backup web interface.

The util-linux NEWS file records `getopt` updates in the 2.11 and 2.13 development era, including replacement with getopt 1.1.3 by Frodo Looijaard and an update to 1.1.4. The man page identifies the command as the enhanced `getopt`, focused on parsing command options for shell procedures.

采用历史

As part of util-linux, enhanced `getopt` is part of the broad Linux userland toolbox. On macOS, Homebrew packages it as `gnu-getopt` and marks it keg-only because macOS provides BSD `getopt`; on Linux, the formula also avoids conflict with the full util-linux package. That packaging split is the main reason the Homebrew package name differs from the upstream project name.

使用方式

Practitioners use `getopt` in shell scripts to normalize short and long options, detect invalid arguments, preserve whitespace through shell quoting, and test whether the enhanced implementation is present. The `-T` probe is explicitly documented for distinguishing this implementation from older `getopt(1)` variants.

为什么软件包爱好者会关心

The package matters because option parsing is a portability trap in shell scripts. Installing `gnu-getopt` gives macOS and other non-GNU environments the util-linux behavior many Linux-oriented scripts expect, while Homebrew's keg-only status prevents accidental replacement of the system utility.

时间线

  • 2001-era util-linux 2.11z: NEWS records replacement with getopt 1.1.3 by Frodo Looijaard.
  • 2007: util-linux-ng 2.13-pre6 NEWS records update to getopt 1.1.4.
  • 2006-2010: util-linux project used the util-linux-ng name.
  • 2026: util-linux README described kernel.org as primary repository and GitHub as backup.

Related projects

  • GNU `getopt(3)` supplies the parsing behavior used by util-linux `getopt(1)`.
  • BSD `getopt` is the system utility that Homebrew avoids shadowing on macOS.
  • util-linux is the upstream userland utility collection that contains the command.

安全态势

尚未找到受保护工具覆盖

没有找到 gnu-getopt 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布,以便未来覆盖拥有稳定的软件包 URL。

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
getoptcli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本2.42.2
管理器更新时间2026-06-16
本地数据OK
上游not checked
检测到的最新版本未检测到

https://github.com/util-linux/util-linux

安装元数据

软件包元数据

软件包键brew:gnu-getopt
版本2.42.2
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/gnu-getopt
主页https://github.com/util-linux/util-linux
仓库https://github.com/util-linux/util-linux
上游文档https://github.com/util-linux/util-linux/blob/master/misc-utils/getopt.1.adoc
许可证GPL-2.0-or-later
源码归档https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.gz
最后更新2026-06-16T16:47:43Z
Pulseupdated
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namegnu-getopt
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyyes
URL Keys
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

zypper95%

gnu-getopt 1.0.14-2.7

Java getopt Implementation

https://www.urbanophile.com/arenn/hacking/download.html

sudo zypper install gnu-getopt
  • License: LGPL-2.1-or-later
  • Category: Development/Libraries/Java
  • Architecture: noarch
  • Source Package: gnu-getopt
  • 1 提供
  • normalized package name match
  • 匹配方式:Gnu Getopt
openSUSE Tumbleweed package metadata · download.opensuse.org · openSUSE Tumbleweed package metadata: gnu-getopt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst
zypper95%

gnu-getopt-javadoc 1.0.14-2.7

Javadoc for gnu.getopt

https://www.urbanophile.com/arenn/hacking/download.html

sudo zypper install gnu-getopt-javadoc
  • License: LGPL-2.1-or-later
  • Category: Development/Libraries/Java
  • Architecture: noarch
  • Source Package: gnu-getopt
  • 1 提供
  • normalized package name match
  • 匹配方式:Gnu Getopt
openSUSE Tumbleweed package metadata · download.opensuse.org · openSUSE Tumbleweed package metadata: gnu-getopt-javadoc from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst
Nix92%

getopt

nix profile install nixpkgs#getopt
  • installed executable or alias match
  • 匹配方式:Getopt
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/ge/getopt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • Nucleus package database
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment