ONOS dev bash_profile function -
make vicell open file for current cell when no cell is specified
Change-Id: Ic561fcafe469531b57199de156f8db12a0e0d063
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 3ff2dde..9492f58 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -154,13 +154,14 @@
function vicell {
local apply=false
local create=false
- local cdf=""
+ local ${cdf:=$ONOS_CELL}
local cpath="${ONOS_ROOT}/tools/test/cells/"
- if [ -z "$1" ] || [ "$1" = "-h" ] ; then
+ if [ "$1" = "-h" ] ; then
printf "usage: vicell [file] [options]\n\noptions:\n"
+ printf "\t[file]: cell name (default: current cell)\n"
printf "\t-a: apply the cell after editing\n"
- printf "\t-e: [editor] set EDITOR to [editor] (default *vi*)\n"
+ printf "\t-e: [editor] set EDITOR to [editor] (default: *vi*)\n"
printf "\t-c: create cell file if none exist\n\n"
return 1
fi
@@ -175,7 +176,7 @@
shift
done
- if [ ! -e "${cpath}${cdf}" ] && [ "$create" = "false" ]; then
+ if [ ! -e "${cpath}${cdf}" ] && ! ($create) ; then
printf "${cdf} : no such cell\n" && return 1
fi
@@ -192,4 +193,4 @@
# Load AT&T MPLS topo GEO data
-alias atttopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/attmpls-cfg.json'
\ No newline at end of file
+alias atttopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/attmpls-cfg.json'