Skip to content
Snippets Groups Projects
Commit 5930a3fe authored by zimoch's avatar zimoch
Browse files

options and help fixed

parent 8e9020dd
No related branches found
No related tags found
1 merge request!7Submodule merge
...@@ -7,55 +7,31 @@ ...@@ -7,55 +7,31 @@
function help() { function help() {
echo "usage: bootinfo [options] [pattern]" echo "usage: bootinfo [options] [pattern]"
echo " Find boot information about %pattern% in database" echo " Find boot information about %pattern% in database"
echo " pattern is matched against IOC,IP_ADDRESS,BOOTPC,PORTSV,LOCATION,SWITCH"
echo "options are:" echo "options are:"
echo " -h, -?, --help : print this help and quit" echo " -h, -?, --help : print this help and quit"
echo " -v, --version : print cvs version info and quit" echo " -v, --version : print cvs version info and quit"
echo " -i : print IP_ADDRESS"
echo " -l : print LOCATION"
echo " -b : print BOOTPC and BOOTPC_IP_ADDR"
echo " -p : print PORTSERVER (server and port)"
echo " -s : print SAVERESTORE (server and if restore should be used)"
echo " -n : print network SWITCH"
echo " -a : print all (= -ilbpsn)"
echo " -- : treat next word as pattern, even if starting with -" echo " -- : treat next word as pattern, even if starting with -"
echo "default options are: -ibl"
exit 0 exit 0
} }
function version() { function version() {
echo 'Author: D. Zimoch' echo 'Author: D. Zimoch'
echo '$Date: 2004/08/02 09:02:38 $' echo '$Date: 2004/08/02 09:05:46 $'
echo '$Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $' echo '$Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $'
exit 0 exit 0
} }
while true while true
do do
case "$1" in case "$1" in
-*h* | -*\?* | --help) help ;; -*h* | -*\?* | --help) help ;;
-*v* | --version) version ;; -*v* | --version) version ;;
--) shift; break ;; --) shift; break ;;
-*) OPTION=$1 -*) echo "Unknown option $1. Try: --help"
while true exit 1 ;;
do *) break ;;
OPTION=${OPTION:1} esac
case "$OPTION" in shift
i*) SEL="$SEL,IP_ADDRESS" ;;
l*) SEL="$SEL,LOCATION" ;;
b*) SEL="$SEL,BOOTPC,BOOTPC_IP_ADDR" ;;
p*) SEL="$SEL,PORTSERVER" ;;
s*) SEL="$SEL,SAVERESTORE" ;;
n*) SEL="$SEL,SWITCH" ;;
a*) SEL="$SEL,IP_ADDRESS,LOCATION,BOOTPC,BOOTPC_IP_ADDR,PORTSERVER,SAVERESTORE,SWITCH" ;;
"") break ;;
*) echo "Unknown option -${OPTION:0:1}. Try: --help"
exit 1 ;;
esac
done ;;
*) break;;
esac
shift
done done
if [ -d /usr/oracle-9.2 ] ; then if [ -d /usr/oracle-9.2 ] ; then
...@@ -100,7 +76,7 @@ ORDER BY 1; ...@@ -100,7 +76,7 @@ ORDER BY 1;
EXIT EXIT
EOF EOF
# $Name: $ # $Name: $
# $Id: bootinfo,v 1.10 2004/08/02 09:02:38 zimoch Exp $ # $Id: bootinfo,v 1.11 2004/08/02 09:05:46 zimoch Exp $
# $Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $ # $Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $
# $Revision: 1.10 $ # $Revision: 1.11 $
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment