mirror of
https://github.com/smxi/inxi.git
synced 2025-02-23 13:32:18 +00:00
Added -p option, show partitions. Like other custom show options, requires -d or -v 1 or greater to run. Leaving -v4 as another way
to trigger this as well.
This commit is contained in:
parent
e3d719f74a
commit
c8b5020760
18
inxi
18
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.4.24
|
||||
#### version: 0.4.25
|
||||
#### Date: November 8 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -80,6 +80,8 @@ B_RUNNING_IN_SHELL='false'
|
|||
B_SHOW_FULL_HDD='false'
|
||||
# Set this to 'false' to avoid printing the hostname
|
||||
B_SHOW_HOST='true'
|
||||
# either -v > 3 or -p will show partitions
|
||||
B_SHOW_PARTITIONS='true'
|
||||
# Show sound card data
|
||||
B_SHOW_SOUND='false'
|
||||
# triggers various debugging and new option testing
|
||||
|
@ -458,7 +460,7 @@ get_parameters()
|
|||
return 1
|
||||
fi
|
||||
|
||||
while getopts c:CdDfFhHsTUv:Vx opt
|
||||
while getopts c:CdDfFhHpsTUv:Vx opt
|
||||
do
|
||||
case $opt in
|
||||
c) if [[ -n $( egrep '^[0-9][0-9]?$' <<< $OPTARG ) ]];then
|
||||
|
@ -483,12 +485,15 @@ get_parameters()
|
|||
;;
|
||||
F) VERBOSITY_LEVEL=$VERBOSITY_LEVELS
|
||||
B_CPU_FLAGS_FULL='true'
|
||||
B_SHOW_FULL_HDD='true'
|
||||
B_SHOW_SOUND='true'
|
||||
B_EXTRA_DATA='true'
|
||||
B_SHOW_FULL_HDD='true'
|
||||
B_SHOW_PARTITIONS='true'
|
||||
B_SHOW_SOUND='true'
|
||||
;;
|
||||
H) B_SHOW_FULL_HDD='true'
|
||||
;;
|
||||
p) B_SHOW_PARTITIONS='true'
|
||||
;;
|
||||
s) B_SHOW_SOUND='true'
|
||||
;;
|
||||
T) B_TESTING_FLAG='true'
|
||||
|
@ -522,7 +527,7 @@ show_options()
|
|||
|
||||
print_screen_output "$SCRIPT_NAME supports the following options. You can combine"
|
||||
print_screen_output "them, or list them one by one: Examples: $SCRIPT_NAME -v4 -c6 OR $SCRIPT_NAME -dc 6"
|
||||
print_screen_output "Note: all extra output options (eg -f, -H, -s, -x) require a verbosity level of 1 or higher."
|
||||
print_screen_output "Note: extra output options (eg -f,-H,-p,-s,-x) require a verbosity level of 1 or higher."
|
||||
print_screen_output "In other words, they only work if you use either -d or -v1 (or higher)"
|
||||
print_screen_output "- - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
||||
print_screen_output "-c Available color schemes. Scheme number is required."
|
||||
|
@ -532,6 +537,7 @@ show_options()
|
|||
print_screen_output "-f Show all cpu flags used, not just the short list."
|
||||
print_screen_output "-F Show Full, all possible, output for $SCRIPT_NAME."
|
||||
print_screen_output "-H Show full hard disk info, not only model, ie: /dev/sda - ST380817AS - 80.0GB."
|
||||
print_screen_output "-p Show partition information (shows what -v4 would show, but without extra data)."
|
||||
print_screen_output "-s Show sound card information."
|
||||
print_screen_output "-U Autoupdate script. Note: if you installed as root, you"
|
||||
print_screen_output " must be root to update, otherwise user is fine."
|
||||
|
@ -1763,7 +1769,7 @@ print_hard_disk_data()
|
|||
print_screen_output "$hdd_data_2"
|
||||
fi
|
||||
|
||||
if [[ $VERBOSITY_LEVEL -ge 4 ]];then
|
||||
if [[ $VERBOSITY_LEVEL -ge 4 || $B_SHOW_PARTITIONS == 'true' ]];then
|
||||
# set A_PARTITION_DATA
|
||||
get_partition_data
|
||||
|
||||
|
|
Loading…
Reference in a new issue