last fine tuning, now for specific irc support purposes, you can see what symbolic link started the real inxi

This commit is contained in:
inxi-svn 2013-01-23 22:41:07 +00:00
parent 66d7f02207
commit 0b43930283

6
inxi
View file

@ -2355,7 +2355,7 @@ show_options()
print_version_info() print_version_info()
{ {
# if not in PATH could be either . or directory name, no slash starting # if not in PATH could be either . or directory name, no slash starting
local script_path=$SCRIPT_PATH local script_path=$SCRIPT_PATH script_symbolic_start=''
if [[ $script_path == '.' ]];then if [[ $script_path == '.' ]];then
script_path=$( pwd ) script_path=$( pwd )
elif [[ -z $( grep '^/' <<< "$script_path" ) ]];then elif [[ -z $( grep '^/' <<< "$script_path" ) ]];then
@ -2364,6 +2364,7 @@ print_version_info()
# handle if it's a symbolic link, rare, but can happen with script directories in irc clients # handle if it's a symbolic link, rare, but can happen with script directories in irc clients
# which would only matter if user starts inxi with -! 30 override in irc client # which would only matter if user starts inxi with -! 30 override in irc client
if [[ -L $script_path/$SCRIPT_NAME ]];then if [[ -L $script_path/$SCRIPT_NAME ]];then
script_symbolic_start=$script_path/$SCRIPT_NAME
script_path=$( readlink $script_path/$SCRIPT_NAME ) script_path=$( readlink $script_path/$SCRIPT_NAME )
script_path=$( dirname $script_path ) script_path=$( dirname $script_path )
fi fi
@ -2374,6 +2375,9 @@ print_version_info()
if [[ $B_RUNNING_IN_SHELL == 'true' ]];then if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
print_screen_output " " print_screen_output " "
print_screen_output "Program Location: $script_path" print_screen_output "Program Location: $script_path"
if [[ -n $script_symbolic_start ]];then
print_screen_output "Started via symbolic link: $script_symbolic_start"
fi
print_screen_output "Website: http://inxi.goooglecode.com - IRC: irc.oftc.net channel: #smxi" print_screen_output "Website: http://inxi.goooglecode.com - IRC: irc.oftc.net channel: #smxi"
print_screen_output "Forums: http://techpatterns.com/forums/forum-33.html" print_screen_output "Forums: http://techpatterns.com/forums/forum-33.html"
print_screen_output " " print_screen_output " "