Commit bc560064 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add long options

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