more options

This commit is contained in:
ville rantanen
2014-03-13 09:31:33 +02:00
parent 76a37edd56
commit f6ccd55634

View File

@@ -7,7 +7,11 @@ usage () { echo "
-b [bundledir] Include bundles. Multiple -b's accepted. -b [bundledir] Include bundles. Multiple -b's accepted.
-l List all components in the given bundles. -l List all components in the given bundles.
-L Display example usage of the component. -L Display example usage of the component.
Give component name as argument to display documentation."; } -s Display short documentation - only the names of ports and parameters.
Give component name as argument to display documentation.
Autobundles are loaded if exist.
"; }
bundlefunc () { bundlefunc () {
for ((i=0; i<${#bundles[@]}; i++ )) do for ((i=0; i<${#bundles[@]}; i++ )) do
@@ -33,7 +37,8 @@ printcomps () {
bundles=( ) bundles=( )
LONGLIST="" LONGLIST=""
options='hb:lL' SHORTLIST=""
options='hb:lLs'
while getopts $options option while getopts $options option
do do
case $option in case $option in
@@ -41,6 +46,7 @@ do
l ) listcomps; printcomps | sort; exit;; l ) listcomps; printcomps | sort; exit;;
L ) LONGLIST="-L";; L ) LONGLIST="-L";;
h ) usage; exit;; h ) usage; exit;;
s ) SHORTLIST="yes";;
: ) echo "Missing option argument for -$OPTARG" >&2; exit 1;; : ) echo "Missing option argument for -$OPTARG" >&2; exit 1;;
esac esac
done done
@@ -58,4 +64,8 @@ then echo -e "\n\nFile $1.and already exists. Remove it first."
exit exit
fi fi
anduril run-component $1 $BUNDLESTRING --doc $LONGLIST if [ -z "$SHORTLIST" ]
then anduril run-component $1 $BUNDLESTRING --doc $LONGLIST
else
anduril run-component $1 $BUNDLESTRING --doc $LONGLIST | grep "^[*=]"
fi