comparison sbin/fports @ 801:8167b2a8b4fe

fports: Change option characters "-A" -> "-n" and "-M" -> "-m"
author Franz Glasner <fzglas.hg@dom66.de>
date Sat, 02 Nov 2024 16:28:55 +0100
parents 1c4d729963dc
children 31ff8e5efdd6
comparison
equal deleted inserted replaced
800:1c4d729963dc 801:8167b2a8b4fe
22 # shellcheck disable=SC2016 # no expansion 22 # shellcheck disable=SC2016 # no expansion
23 USAGE=' 23 USAGE='
24 USAGE: fports -h 24 USAGE: fports -h
25 fports -V 25 fports -V
26 fports deptree [-l maxlevel] [-r] [-t] package... 26 fports deptree [-l maxlevel] [-r] [-t] package...
27 fports detail -A 27 fports detail -n
28 fports detail -M 28 fports detail -m
29 fports detail package... 29 fports detail package...
30 30
31 GLOBAL OPTIONS: 31 GLOBAL OPTIONS:
32 32
33 -V Print the program name and version number to stdout and exit 33 -V Print the program name and version number to stdout and exit
353 repo title_printed indexfile _dummy opt acookie \ 353 repo title_printed indexfile _dummy opt acookie \
354 pkglabel pkgdescr pkgversion mapped_package 354 pkglabel pkgdescr pkgversion mapped_package
355 355
356 opt_noauto=no 356 opt_noauto=no
357 opt_mapped=no 357 opt_mapped=no
358 while getopts "AM" opt; do 358 while getopts "nm" opt; do
359 case "${opt}" in 359 case "${opt}" in
360 A) 360 n)
361 # shellcheck disable=SC2034 # appears unused 361 # shellcheck disable=SC2034 # appears unused
362 opt_noauto=yes;; 362 opt_noauto=yes;;
363 M) 363 m)
364 # shellcheck disable=SC2034 # appears unused 364 # shellcheck disable=SC2034 # appears unused
365 opt_mapped=yes;; 365 opt_mapped=yes;;
366 \?) 366 \?)
367 exit 2;; 367 exit 2;;
368 *) 368 *)
371 done 371 done
372 shift $((OPTIND-1)) 372 shift $((OPTIND-1))
373 OPTIND=1 373 OPTIND=1
374 374
375 if checkyesno opt_noauto || checkyesno opt_mapped; then 375 if checkyesno opt_noauto || checkyesno opt_mapped; then
376 [ $# -gt 0 ] && fatal "${EX_USAGE}" "packages are now allowed for options -A or -M" 376 [ $# -gt 0 ] && fatal "${EX_USAGE}" "packages are now allowed for options -n or -m"
377 if checkyesno opt_noauto && checkyesno opt_mapped; then 377 if checkyesno opt_noauto && checkyesno opt_mapped; then
378 fatal "${EX_USAGE}" "cannot use -A and -M together" 378 fatal "${EX_USAGE}" "cannot use -n and -m together"
379 fi 379 fi
380 fi 380 fi
381 381
382 repositories='' 382 repositories=''
383 get_active_repositories repositories 383 get_active_repositories repositories