Made sound show with -s option; removed showing help menu on mistyped option, or unsupported option, this would make

spammy irc stuff. Instead shows message to run inxi -h for more information
This commit is contained in:
inxi-svn 2008-11-07 20:45:25 +00:00
parent 78a2872406
commit eb81af5e82

22
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.3.31
#### version: 0.3.32
#### Date: November 7 2008
########################################################################
#### inxi is a fork of infobash, the original bash sys info script by locsmif
@ -77,6 +77,8 @@ B_HANDLE_CORRUPT_DATA='false'
B_RUNNING_IN_SHELL='false'
# Set this to 'false' to avoid printing the hostname
B_SHOW_HOST='true'
# Show sound card data
B_SHOW_SOUND='false'
# triggers various debugging and new option testing
B_TESTING_FLAG='false'
# Test for X running
@ -113,7 +115,7 @@ SHOW_IRC=2
# Verbosity level defaults to 0, this can also be set with -v0, -v2, -v3, etc as a parameter.
VERBOSITY_LEVEL=0
# Supported number of verbosity levels, including 0
VERBOSITY_LEVELS=6
VERBOSITY_LEVELS=5
# Clear nullglob, because it creates unpredictable situations with IFS=$'\n' ARR=($VAR) IFS="$ORIGINAL_IFS"
# type constructs. Stuff like [rev a1] is now seen as a glob expansion pattern, and fails, and
@ -214,7 +216,7 @@ error_handler()
;;
6) error_message="/proc not found! Quitting..."
;;
7) error_message="unknown parameter: $2"
7) error_message="unsupported script parameter: $2\nFor supported options, check the help menu: $SCRIPT_NAME -h"
;;
8) error_message="the self-updater failed, wget exited with error: $2.\nYou probably need to be root.\nHint, to make for easy updates without being root, do: chown <user name> $SCRIPT_NAME"
;;
@ -453,7 +455,7 @@ get_parameters()
return 1
fi
while getopts c:CdDfhTUv:Vx opt
while getopts c:CdDfhsTUv:Vx opt
do
case $opt in
c) if [[ -n $( egrep '^[0-9][0-9]?$' <<< $OPTARG ) ]];then
@ -476,6 +478,8 @@ get_parameters()
;;
f) B_CPU_FLAGS_FULL='true'
;;
s) B_SHOW_SOUND='true'
;;
T) B_TESTING_FLAG='true'
;;
v) if [[ -n $( egrep "^[0-9][0-9]?$" <<< $OPTARG ) && $OPTARG -le $VERBOSITY_LEVELS ]];then
@ -494,8 +498,7 @@ get_parameters()
h) show_options
exit 0
;;
*) show_options
error_handler 7 "$opt"
*) error_handler 7 "$opt"
;;
esac
done
@ -524,7 +527,6 @@ show_options()
print_screen_output " 3 - Also show hard disk names as detected."
print_screen_output " 4 - Also show partition size/filled data for (if present):/, /home, /var/, /boot"
print_screen_output " 5 - For multicore systems, also show per core clock speeds."
print_screen_output " 6 - Also show audio card data."
print_screen_output "-V $SCRIPT_NAME version information. Prints information then exits."
print_screen_output "-x Show extra data, for example bogomips on cpu output."
rint_screen_output ""
@ -1244,6 +1246,10 @@ get_hard_drive_data()
}
# get_hard_drive_data;exit
get_lspci_data()
{
echo "$( lspci -v | gawk '{
@ -1811,7 +1817,7 @@ print_it_out()
print_intro_data
print_cpu_data
print_gfx_data
if [[ $VERBOSITY_LEVEL -ge 6 ]];then
if [[ $B_SHOW_SOUND == 'true' ]];then
print_audio_data
fi
if [[ $VERBOSITY_LEVEL -ge 2 ]];then