Added option to show architecture for all OS types with ''

This commit is contained in:
Dylan 2016-02-01 14:45:53 +11:00
parent 07956cdabb
commit d90d7259a9
3 changed files with 17 additions and 13 deletions

View File

@ -213,6 +213,7 @@ alias fetch2="fetch \
usage: ${0##*/} --option "value"
Info:
--os_arch on/off Hide/Show Windows architecture.
--osx_buildversion Hide/Show Mac OS X build version.
--speed_type Change the type of cpu speed to display.
Possible values: current, min, max, bios,

View File

@ -59,9 +59,9 @@ kernel_shorthand="on"
# --osx_buildversion on/off
osx_buildversion="on"
# Show '64-bit' / '32-bit' in 'Distro:'
# --windows_bits on /off
windows_bits="on"
# Show 'x86_64' and 'x86' in 'Distro:' output.
# --os_arch on/off
os_arch="on"
# Uptime

23
fetch
View File

@ -79,9 +79,9 @@ kernel_shorthand="on"
# --osx_buildversion on/off
osx_buildversion="on"
# Show '64-bit' / '32-bit' in 'Distro:'
# --windows_bits on /off
windows_bits="on"
# Show 'x86_64' and 'x86' in 'Distro:' output.
# --os_arch on/off
os_arch="on"
# Uptime
@ -407,12 +407,8 @@ case "$os" in
"Windows")
distro="$(wmic os get Caption /value)"
[ "$windows_bits" == "on" ] && \
distro+=" $(wmic os get OSArchitecture /value)"
# Strip crap from the output of wmic
distro=${distro/Caption'='}
distro=${distro/OSArchitecture'='}
distro=${distro//[[:space:]]/ }
distro=${distro// }
distro=${distro/Microsoft }
@ -425,7 +421,14 @@ esac
ascii_distro="$distro"
getdistro () {
distro="$distro"
# Overflow integer to get architecture
if [ "$os_arch" == "on" ]; then
if ((1<<32)); then
distro+=" x86_64"
else
distro+=" x86"
fi
fi
}
@ -1878,7 +1881,7 @@ usage () { cat << EOF
Info:
--osx_buildversion Hide/Show Mac OS X build version.
--windows_bits on/off Hide/Show Windows architecture.
--os_arch on/off Hide/Show Windows architecture.
--speed_type Change the type of cpu speed to display.
Possible values: current, min, max, bios,
scaling_current, scaling_min, scaling_max
@ -1979,7 +1982,7 @@ exit 1
while [ "$1" ]; do
case $1 in
# Info
--windows_bits) windows_bits="$2" ;;
--os_arch) os_arch="$2" ;;
--osx_buildversion) osx_buildversion="$2" ;;
--speed_type) speed_type="$2" ;;
--kernel_shorthand) kernel_shorthand="$2" ;;