Committed by
Ray Milkey
ONOS dev bash_profile function -
make vicell open file for current cell when no cell is specified Change-Id: Ic561fcafe469531b57199de156f8db12a0e0d063
Showing
1 changed file
with
6 additions
and
5 deletions
| ... | @@ -154,13 +154,14 @@ function nuke { | ... | @@ -154,13 +154,14 @@ function nuke { |
| 154 | function vicell { | 154 | function vicell { |
| 155 | local apply=false | 155 | local apply=false |
| 156 | local create=false | 156 | local create=false |
| 157 | - local cdf="" | 157 | + local ${cdf:=$ONOS_CELL} |
| 158 | local cpath="${ONOS_ROOT}/tools/test/cells/" | 158 | local cpath="${ONOS_ROOT}/tools/test/cells/" |
| 159 | 159 | ||
| 160 | - if [ -z "$1" ] || [ "$1" = "-h" ] ; then | 160 | + if [ "$1" = "-h" ] ; then |
| 161 | printf "usage: vicell [file] [options]\n\noptions:\n" | 161 | printf "usage: vicell [file] [options]\n\noptions:\n" |
| 162 | + printf "\t[file]: cell name (default: current cell)\n" | ||
| 162 | printf "\t-a: apply the cell after editing\n" | 163 | printf "\t-a: apply the cell after editing\n" |
| 163 | - printf "\t-e: [editor] set EDITOR to [editor] (default *vi*)\n" | 164 | + printf "\t-e: [editor] set EDITOR to [editor] (default: *vi*)\n" |
| 164 | printf "\t-c: create cell file if none exist\n\n" | 165 | printf "\t-c: create cell file if none exist\n\n" |
| 165 | return 1 | 166 | return 1 |
| 166 | fi | 167 | fi |
| ... | @@ -175,7 +176,7 @@ function vicell { | ... | @@ -175,7 +176,7 @@ function vicell { |
| 175 | shift | 176 | shift |
| 176 | done | 177 | done |
| 177 | 178 | ||
| 178 | - if [ ! -e "${cpath}${cdf}" ] && [ "$create" = "false" ]; then | 179 | + if [ ! -e "${cpath}${cdf}" ] && ! ($create) ; then |
| 179 | printf "${cdf} : no such cell\n" && return 1 | 180 | printf "${cdf} : no such cell\n" && return 1 |
| 180 | fi | 181 | fi |
| 181 | 182 | ||
| ... | @@ -192,4 +193,4 @@ function vicell { | ... | @@ -192,4 +193,4 @@ function vicell { |
| 192 | 193 | ||
| 193 | 194 | ||
| 194 | # Load AT&T MPLS topo GEO data | 195 | # Load AT&T MPLS topo GEO data |
| 195 | -alias atttopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/attmpls-cfg.json' | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 196 | +alias atttopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/attmpls-cfg.json' | ... | ... |
-
Please register or login to post a comment