Ayaka Koshibe
Committed by Ray Milkey

ONOS dev bash_profile function -

make vicell open file for current cell when no cell is specified

Change-Id: Ic561fcafe469531b57199de156f8db12a0e0d063
......@@ -154,13 +154,14 @@ function nuke {
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 @@ function vicell {
shift
done
if [ ! -e "${cpath}${cdf}" ] && [ "$create" = "false" ]; then
if [ ! -e "${cpath}${cdf}" ] && ! ($create) ; then
printf "${cdf} : no such cell\n" && return 1
fi
......