diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh old mode 100644 new mode 100755 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -38,7 +38,8 @@ pci Options: - -n -- Do not install package, only print the results + -N -- Do not install packages, only list them one a line + -n -- Do not install packages, only print the results -v -- More verbose EOF exit 1 @@ -74,11 +75,16 @@ esac } +ONE_A_LINE=n DRY_RUN=n VERBOSE=n while [ $# -gt 0 ]; do case $1 in + -N) + ONE_A_LINE=y + DRY_RUN=y + ;; -n) DRY_RUN=y ;; @@ -110,6 +116,16 @@ "${subsystem}"_search_packages done +if [ "${ONE_A_LINE}" = "y" ]; then + for pkg in "${packages}"; do + case "${pkg}" in + ""|^[[:space:]]*$) continue ;; + esac + echo "${pkg}" + done + exit 0 +fi + case "${packages}" in ""|^[[:space:]]*$) echo "No firmware packages to install."