added line wraps for very long partition lines

This commit is contained in:
inxi-svn 2011-07-22 07:46:20 +00:00
parent 9de355d4be
commit cb2301e127

13
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.7.19 #### version: 1.7.20
#### Date: July 22 2011 #### Date: July 22 2011
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
@ -7313,8 +7313,17 @@ print_partition_data()
else else
partitionIdClean=${a_partition_working[0]} partitionIdClean=${a_partition_working[0]}
fi fi
id_size_fs="${C1}ID:${C2} $partitionIdClean ${C1}size$SEP3${C2} ${a_partition_working[1]}$partition_used$full_fs$full_dev"
label_uuid="$full_label$full_uuid"
# label/uuid always print one per line, so only wrap if it's very long
if [[ $B_SHOW_UUIDS == 'true' && $B_SHOW_LABELS == 'true' && $( calculate_line_length "$id_size_fs$label_uuid" ) -gt $LINE_MAX ]];then
a_partition_data[$counter]="$id_size_fs"
((counter++))
a_partition_data[$counter]="$label_uuid"
else
a_partition_data[$counter]="${a_partition_data[$counter]}$id_size_fs$label_uuid"
fi
# because these lines can vary widely, using dynamic length handling here # because these lines can vary widely, using dynamic length handling here
a_partition_data[$counter]="${a_partition_data[$counter]}${C1}ID:${C2} $partitionIdClean ${C1}size$SEP3${C2} ${a_partition_working[1]}$partition_used$full_fs$full_dev$full_label$full_uuid "
if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]] || [[ $( calculate_line_length "${a_partition_data[$counter]}" ) -gt $line_max ]];then if [[ $B_SHOW_LABELS == 'true' || $B_SHOW_UUIDS == 'true' ]] || [[ $( calculate_line_length "${a_partition_data[$counter]}" ) -gt $line_max ]];then
((counter++)) ((counter++))
fi fi