mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 00:47:47 +00:00
(Change Version)
Final step: moved the error output switch to end of get_parameters. This lets you trigger the debugger -@ <debug number> flag without having to actually alter the code of inxi manually. This might occasionally create undesired error output, but that's a good thing, since that error output should be seen so we can know what the error is.
This commit is contained in:
parent
5c754f182b
commit
241dc099b4
18
inxi
18
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.5.12
|
||||
#### version: 0.5.13
|
||||
#### Date: November 11 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -129,12 +129,8 @@ DCOPOBJ="default"
|
|||
DEBUG=0 # Set debug levels from 1-10
|
||||
# Debug Buffer Index, index into a debug buffer storing debug messages until inxi is 'all up'
|
||||
DEBUG_BUFFER_INDEX=0
|
||||
### Reroute all error messages to the bitbucket (if not debugging)
|
||||
if [[ $DEBUG -eq 0 ]]
|
||||
then
|
||||
exec 2>/dev/null
|
||||
fi
|
||||
#((DEBUG)) && exec 2>&1 # This is for debugging konversation
|
||||
## note: the debugger rerouting to /dev/null has been moved to the end of the get_parameters function
|
||||
## so -@[number] debug levels can be set if there is a failure, otherwise you can't even see the errors
|
||||
|
||||
# Defaults to 2, make this 1 for normal, 0 for no colorcodes at all. Set to any other valid scheme you like.
|
||||
# Same as runtime parameter.
|
||||
|
@ -481,7 +477,7 @@ get_cmdline()
|
|||
while read -d $'\0' L && [ "$i" -lt 32 ]
|
||||
do
|
||||
A_CMDL[i++]="$L" ## note: make sure this is valid - What does L mean? ##
|
||||
done </proc/$ppid/cmdline
|
||||
done < /proc/$ppid/cmdline
|
||||
##print_screen_output "\$i='$i'"
|
||||
if [[ $i -eq 0 ]];then
|
||||
A_CMDL[0]=$(< /proc/$ppid/cmdline)
|
||||
|
@ -597,6 +593,12 @@ get_parameters()
|
|||
;;
|
||||
esac
|
||||
done
|
||||
## this must occur here so you can use the debugging flag to show errors
|
||||
## Reroute all error messages to the bitbucket (if not debugging)
|
||||
if [[ $DEBUG -eq 0 ]];then
|
||||
exec 2>/dev/null
|
||||
fi
|
||||
#((DEBUG)) && exec 2>&1 # This is for debugging konversation
|
||||
}
|
||||
|
||||
## print out help menu, not including Testing or Debugger stuff because it's not needed
|
||||
|
|
Loading…
Reference in a new issue