Added option to show architecture for all OS types with ''
This commit is contained in:
parent
07956cdabb
commit
d90d7259a9
|
@ -213,6 +213,7 @@ alias fetch2="fetch \
|
||||||
usage: ${0##*/} --option "value"
|
usage: ${0##*/} --option "value"
|
||||||
|
|
||||||
Info:
|
Info:
|
||||||
|
--os_arch on/off Hide/Show Windows architecture.
|
||||||
--osx_buildversion Hide/Show Mac OS X build version.
|
--osx_buildversion Hide/Show Mac OS X build version.
|
||||||
--speed_type Change the type of cpu speed to display.
|
--speed_type Change the type of cpu speed to display.
|
||||||
Possible values: current, min, max, bios,
|
Possible values: current, min, max, bios,
|
||||||
|
|
|
@ -59,9 +59,9 @@ kernel_shorthand="on"
|
||||||
# --osx_buildversion on/off
|
# --osx_buildversion on/off
|
||||||
osx_buildversion="on"
|
osx_buildversion="on"
|
||||||
|
|
||||||
# Show '64-bit' / '32-bit' in 'Distro:'
|
# Show 'x86_64' and 'x86' in 'Distro:' output.
|
||||||
# --windows_bits on /off
|
# --os_arch on/off
|
||||||
windows_bits="on"
|
os_arch="on"
|
||||||
|
|
||||||
|
|
||||||
# Uptime
|
# Uptime
|
||||||
|
|
23
fetch
23
fetch
|
@ -79,9 +79,9 @@ kernel_shorthand="on"
|
||||||
# --osx_buildversion on/off
|
# --osx_buildversion on/off
|
||||||
osx_buildversion="on"
|
osx_buildversion="on"
|
||||||
|
|
||||||
# Show '64-bit' / '32-bit' in 'Distro:'
|
# Show 'x86_64' and 'x86' in 'Distro:' output.
|
||||||
# --windows_bits on /off
|
# --os_arch on/off
|
||||||
windows_bits="on"
|
os_arch="on"
|
||||||
|
|
||||||
|
|
||||||
# Uptime
|
# Uptime
|
||||||
|
@ -407,12 +407,8 @@ case "$os" in
|
||||||
"Windows")
|
"Windows")
|
||||||
distro="$(wmic os get Caption /value)"
|
distro="$(wmic os get Caption /value)"
|
||||||
|
|
||||||
[ "$windows_bits" == "on" ] && \
|
|
||||||
distro+=" $(wmic os get OSArchitecture /value)"
|
|
||||||
|
|
||||||
# Strip crap from the output of wmic
|
# Strip crap from the output of wmic
|
||||||
distro=${distro/Caption'='}
|
distro=${distro/Caption'='}
|
||||||
distro=${distro/OSArchitecture'='}
|
|
||||||
distro=${distro//[[:space:]]/ }
|
distro=${distro//[[:space:]]/ }
|
||||||
distro=${distro// }
|
distro=${distro// }
|
||||||
distro=${distro/Microsoft }
|
distro=${distro/Microsoft }
|
||||||
|
@ -425,7 +421,14 @@ esac
|
||||||
ascii_distro="$distro"
|
ascii_distro="$distro"
|
||||||
|
|
||||||
getdistro () {
|
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:
|
Info:
|
||||||
--osx_buildversion Hide/Show Mac OS X build version.
|
--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.
|
--speed_type Change the type of cpu speed to display.
|
||||||
Possible values: current, min, max, bios,
|
Possible values: current, min, max, bios,
|
||||||
scaling_current, scaling_min, scaling_max
|
scaling_current, scaling_min, scaling_max
|
||||||
|
@ -1979,7 +1982,7 @@ exit 1
|
||||||
while [ "$1" ]; do
|
while [ "$1" ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
# Info
|
# Info
|
||||||
--windows_bits) windows_bits="$2" ;;
|
--os_arch) os_arch="$2" ;;
|
||||||
--osx_buildversion) osx_buildversion="$2" ;;
|
--osx_buildversion) osx_buildversion="$2" ;;
|
||||||
--speed_type) speed_type="$2" ;;
|
--speed_type) speed_type="$2" ;;
|
||||||
--kernel_shorthand) kernel_shorthand="$2" ;;
|
--kernel_shorthand) kernel_shorthand="$2" ;;
|
||||||
|
|
Reference in New Issue