mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-24 14:31:05 +00:00
79 lines
1.2 KiB
Plaintext
79 lines
1.2 KiB
Plaintext
NEW
|
||
PREFIX
|
||
AUTO 4,1
|
||
#!/bin/sh
|
||
#
|
||
# This is the Main HELP script
|
||
# It displays pages located in usr/share/help
|
||
#
|
||
function nh {
|
||
echo \nHelp is not available for $1
|
||
echo "Try \e[7mhelp list\e[0m for a list of help topics\n"
|
||
}
|
||
set hp = ${BOOT}usr/share/help
|
||
if ![ -D ${hp} ]
|
||
echo "\nA2osX Help files are not installed"
|
||
echo "Please update your A2osX installation\n"
|
||
exit
|
||
fi
|
||
pushd $hp
|
||
switch $#
|
||
case 0
|
||
echo "\nNo Help Argument specified"
|
||
echo "try \e[7mhelp help\e[0m for more information on the help command\n"
|
||
exit
|
||
break
|
||
case 1
|
||
if [ $1 = "list" ]
|
||
ls -R
|
||
exit
|
||
fi
|
||
if [ -f $1 ]
|
||
set hf = $1
|
||
else
|
||
call nh $1
|
||
exit
|
||
fi
|
||
break
|
||
case 2
|
||
if [ -f "$1.help/$2" ]
|
||
set hf = "$1.help/$2"
|
||
else
|
||
if [ -f $1 ]
|
||
set hf = $1
|
||
fi
|
||
fi
|
||
if [ -z $hf ]
|
||
call nh "$1 $2"
|
||
exit
|
||
fi
|
||
break
|
||
case 3
|
||
if [ -f "$1.help/$2.help/$3" ]
|
||
set hf = "$1.help/$2.help/$3"
|
||
else
|
||
call nh "$1 $2 $3"
|
||
exit
|
||
fi
|
||
break
|
||
default
|
||
echo \nToo Many Arguments\n
|
||
end
|
||
if [ -n $hf ]
|
||
for l in ($hf)
|
||
switch $l
|
||
case PAGE
|
||
echo -n "\nPress a key"
|
||
pause
|
||
echo "\b\b\b\b\b\b\b\b\b\b\b "
|
||
break
|
||
Case BL
|
||
echo;break
|
||
default
|
||
echo $l
|
||
end
|
||
next
|
||
fi
|
||
MAN
|
||
TEXT BIN/help
|