Commit bc560064 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add long options

parent 25c30275
...@@ -693,7 +693,7 @@ get_memory_size() ...@@ -693,7 +693,7 @@ get_memory_size()
[ -r /proc/meminfo ] && detected=$((`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`/1024)) [ -r /proc/meminfo ] && detected=$((`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`/1024))
;; ;;
solaris) solaris)
detected=$(prtconf | grep Memory | sed -e "s|Memory size: \([0-9][0-9]*\) Megabyte.*|\1|") detected=$(prtconf | grep Memory | sed -e "s|Memory size: \([0-9][0-9]*\) Megabyte.*|\1|") #"
;; ;;
# *) # *)
# fatal "Unsupported OS $DIST_OS" # fatal "Unsupported OS $DIST_OS"
...@@ -828,30 +828,32 @@ case "$1" in ...@@ -828,30 +828,32 @@ case "$1" in
echo "distro_info v$PROGVERSION - distro information retriever" echo "distro_info v$PROGVERSION - distro information retriever"
echo "Usage: distro_info [options] [SystemName/Version]" echo "Usage: distro_info [options] [SystemName/Version]"
echo "Options:" echo "Options:"
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -h | --help - this help"
echo " -b - print size of arch bit (32/64)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -c - print number of CPU cores" echo " -b - print size of arch bit (32/64)"
echo " --codename - print distro codename (focal for Ubuntu 20.04)" echo " -c - print number of CPU cores"
echo " -z - print current CPU MHz" echo " -i - print virtualization type"
echo " -d - print distro name" echo " -m - print system memory size (in MB)"
echo " -e - print full name of distro with version" echo " -y - print running service manager"
echo " -i - print virtualization type" echo " -z - print current CPU MHz"
echo " -h - this help" echo " --glibc-version - print system glibc version"
echo " -m - print system memory size (in MB)" echo
echo " -o - print base OS name" echo " -d | --distro-name - print distro name"
echo " -p - print type of the packaging system" echo " -e - print full name of distro with version"
echo " -g - print name of the packaging system" echo " -o | --os-name - print base OS name"
echo " -s|-n - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)" echo " -p | package-type - print type of the packaging system"
echo " -y - print running service manager" echo " -g - print name of the packaging system"
echo " --pretty - print pretty distro name" echo " -s|-n|--vendor-name - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo " -v - print version of the distro" echo " --pretty|--pretty-name - print pretty distro name"
echo " --full-version - print full version of the distro" echo " -v | --base-version - print version of the distro"
echo " --glibc-version - print system glibc version" echo " --full-version - print full version of the distro"
echo " -V - print the utility version" echo " --codename (obsoleted) - print distro codename (focal for Ubuntu 20.04)"
echo " --repo-name - print repository name (focal for Ubuntu 20.04)"
echo " -V - print the utility version"
echo "Run without args to print all information." echo "Run without args to print all information."
exit 0 exit 0
;; ;;
-p) -p|--package-type)
override_distrib "$2" override_distrib "$2"
pkgtype pkgtype
exit 0 exit 0
...@@ -861,7 +863,7 @@ case "$1" in ...@@ -861,7 +863,7 @@ case "$1" in
pkgmanager pkgmanager
exit 0 exit 0
;; ;;
--pretty) --pretty|--pretty-name)
override_distrib "$2" override_distrib "$2"
print_pretty_name print_pretty_name
;; ;;
...@@ -880,7 +882,7 @@ case "$1" in ...@@ -880,7 +882,7 @@ case "$1" in
get_glibc_version get_glibc_version
exit 0 exit 0
;; ;;
-d) -d|--distro-name)
override_distrib "$2" override_distrib "$2"
echo $DISTRIB_ID echo $DISTRIB_ID
;; ;;
...@@ -908,10 +910,10 @@ case "$1" in ...@@ -908,10 +910,10 @@ case "$1" in
-m) -m)
get_memory_size get_memory_size
;; ;;
-o) -o|--os-name)
get_base_os_name get_base_os_name
;; ;;
-v) -v|--base-version)
override_distrib "$2" override_distrib "$2"
echo "$DISTRIB_RELEASE" echo "$DISTRIB_RELEASE"
;; ;;
...@@ -919,7 +921,7 @@ case "$1" in ...@@ -919,7 +921,7 @@ case "$1" in
override_distrib "$2" override_distrib "$2"
echo "$DISTRIB_FULL_RELEASE" echo "$DISTRIB_FULL_RELEASE"
;; ;;
-s|-n) -s|-n|--vendor-name)
override_distrib "$2" override_distrib "$2"
pkgvendor pkgvendor
exit 0 exit 0
......
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