Commit 7753a62a authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: print output line for every option

parent f2b24502
...@@ -714,7 +714,7 @@ local DIST_BIT ...@@ -714,7 +714,7 @@ local DIST_BIT
DIST_BIT="$(getconf LONG_BIT 2>/dev/null)" DIST_BIT="$(getconf LONG_BIT 2>/dev/null)"
if [ -n "$DIST_BIT" ] ; then if [ -n "$DIST_BIT" ] ; then
echo "$DIST_BIT" echo "$DIST_BIT"
exit return
fi fi
# Try detect arch size by arch name # Try detect arch size by arch name
...@@ -929,64 +929,63 @@ print_help() ...@@ -929,64 +929,63 @@ print_help()
fill_distr_info fill_distr_info
[ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic" [ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic"
if [ -n "$*" ] ; then
case "$2" in eval lastarg=\${$#}
case "$lastarg" in
-*) -*)
echo "Unsupported option $2" >&2
exit 1
;; ;;
esac *)
override_distrib "$lastarg"
# drop last arg
set -- "${@:1:$(($#-1))}"
;;
esac
fi
if [ -z "$1" ] ; then
print_total_info
exit
fi
while [ -n "$1" ] ; do
case "$1" in case "$1" in
-h|--help) -h|--help)
print_help print_help
exit 0 exit 0
;; ;;
-p|--package-type) -p|--package-type)
override_distrib "$2"
pkgtype pkgtype
exit 0
;; ;;
-g) -g)
override_distrib "$2"
pkgmanager pkgmanager
exit 0
;; ;;
--pretty|--pretty-name) --pretty|--pretty-name)
override_distrib "$2"
print_pretty_name print_pretty_name
;; ;;
--distro-arch) --distro-arch)
override_distrib "$2"
get_distro_arch get_distro_arch
exit 0
;; ;;
--debian-arch) --debian-arch)
override_distrib "$2"
get_debian_arch get_debian_arch
exit 0
;; ;;
--glibc-version) --glibc-version)
override_distrib "$2"
get_glibc_version get_glibc_version
exit 0
;; ;;
-d|--base-distro-name) -d|--base-distro-name)
override_distrib "$2"
echo $DISTRIB_ID echo $DISTRIB_ID
;; ;;
--distro-name) --distro-name)
override_distrib "$2"
echo $DISTRO_NAME echo $DISTRO_NAME
;; ;;
--codename) --codename)
override_distrib "$2"
print_codename print_codename
;; ;;
-a) -a)
override_distrib "$2" if [ -n "$DIST_ARCH" ] ; then
[ -n "$DIST_ARCH" ] && echo "$DIST_ARCH" && exit 0 echo "$DIST_ARCH"
else
get_arch get_arch
fi
;; ;;
-b) -b)
get_bit_size get_bit_size
...@@ -1004,52 +1003,39 @@ case "$1" in ...@@ -1004,52 +1003,39 @@ case "$1" in
get_memory_size get_memory_size
;; ;;
-o|--os-name) -o|--os-name)
override_distrib "$2"
get_base_os_name get_base_os_name
;; ;;
-r|--repo-name) -r|--repo-name)
override_distrib "$2"
print_repo_name print_repo_name
;; ;;
--build-id) --build-id)
echo "$BUILD_ID" echo "$BUILD_ID"
;; ;;
-v|--base-version) -v|--base-version)
override_distrib "$2"
echo "$DISTRIB_RELEASE" echo "$DISTRIB_RELEASE"
;; ;;
--full-version|--distro-version) --full-version|--distro-version)
override_distrib "$2"
echo "$DISTRIB_FULL_RELEASE" echo "$DISTRIB_FULL_RELEASE"
;; ;;
--bug-report-url) --bug-report-url)
print_bug_report_url print_bug_report_url
exit
;; ;;
-s|-n|--vendor-name) -s|-n|--vendor-name)
override_distrib "$2"
pkgvendor pkgvendor
exit 0
;; ;;
-y|--service-manager) -y|--service-manager)
override_distrib "$2"
get_service_manager get_service_manager
;; ;;
-V) -V)
echo "$PROGVERSION" echo "$PROGVERSION"
exit 0
;; ;;
-e) -e)
override_distrib "$2"
print_name_version print_name_version
;; ;;
-*) -*)
echo "Unsupported option $1" >&2 echo "Unsupported option $1" >&2
exit 1 exit 1
;; ;;
*)
override_distrib "$1"
print_total_info
;;
esac esac
shift
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment