summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-10-21 15:25:09 -0500
committerJohn Southworth <john.southworth@vyatta.com>2011-10-21 15:25:09 -0500
commit5427c839fcb2d951ef6f1a400fdd080fedb8886e (patch)
tree5c6752b4999286a25d0473c4d41debbaca3eeaf8
parent7793bf43e337fd24fa8f09ec9a943954ccb5253a (diff)
downloadvyatta-op-5427c839fcb2d951ef6f1a400fdd080fedb8886e.tar.gz
vyatta-op-5427c839fcb2d951ef6f1a400fdd080fedb8886e.zip
Bugfix 7577: Only show the remote uri help if there is no completion
-rw-r--r--functions/interpreter/vyatta-image-complete7
-rw-r--r--templates/copy/file/node.tag/node.def4
-rw-r--r--templates/copy/file/node.tag/to/node.tag/node.def3
3 files changed, 7 insertions, 7 deletions
diff --git a/functions/interpreter/vyatta-image-complete b/functions/interpreter/vyatta-image-complete
index 130fa13..622123b 100644
--- a/functions/interpreter/vyatta-image-complete
+++ b/functions/interpreter/vyatta-image-complete
@@ -51,6 +51,10 @@ _vyatta_image_file_complete()
_vyatta_image_path_complete
}
+declare -a non_comps=( "http://<user>:<passwd>@<host>/<file>" \
+ "scp://<user>:<passwd>@<host>/<file>" \
+ "ftp://<user>:<passwd>@<host>/<file>" \
+ "tftp://<host>/<file>" )
_vyatta_image_path_complete()
{
@@ -59,6 +63,7 @@ _vyatta_image_path_complete()
if _vyatta_image_is_file $cur ; then
foundfile=1
_vyatta_op_completions=( "${cur} " )
+ _vyatta_op_noncompletions=( )
return 0;
fi
if [[ ${cur:0:1} =~ "/" ]]; then
@@ -80,7 +85,9 @@ _vyatta_image_path_complete()
if [[ -d /live/image/opt/vyatta/etc/config || -d /live/image/config ]]; then
reply+=( "disk-install://" )
fi
+ _vyatta_op_noncompletions=( "${non_comps[@]}" )
else
+ _vyatta_op_noncompletions=( )
if ! [[ $cur =~ .*:\/\/ ]]; then
if [[ $cur =~ .*:\/ ]]; then
cur=${cur/:\//}
diff --git a/templates/copy/file/node.tag/node.def b/templates/copy/file/node.tag/node.def
index b19b788..50b9153 100644
--- a/templates/copy/file/node.tag/node.def
+++ b/templates/copy/file/node.tag/node.def
@@ -1,7 +1,3 @@
help: Copy files from specified source
- scp://<user>:<passwd>@<host>/<file>
- ftp://<user>:<passwd>@<host>/<file>
- http://<user>:<passwd>@<host>/<file>
- tftp://<host>/<file>
comptype: imagefiles
allowed: echo -n "<imagefiles>"
diff --git a/templates/copy/file/node.tag/to/node.tag/node.def b/templates/copy/file/node.tag/to/node.tag/node.def
index 0f03a23..b9a136e 100644
--- a/templates/copy/file/node.tag/to/node.tag/node.def
+++ b/templates/copy/file/node.tag/to/node.tag/node.def
@@ -1,7 +1,4 @@
help: Copy files to specified destination
- scp://<user>:<passwd>@<host>/<file>
- ftp://<user>:<passwd>@<host>/<file>
- tftp://<host>/<file>
comptype: imagefiles
allowed: echo -n "<imagefiles>"
run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];