diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-04-06 13:54:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-06 13:54:06 +0300 |
commit | 39d901c16aba8e159d8e250914e744fa74edacd3 (patch) | |
tree | 47e24e850355bf34d179a79cce413db3a836cf44 | |
parent | f474a575f23465dfe93ba2ae44a8076659c5546a (diff) | |
parent | 409c9b84d95f28a2023b69f3ff8c6e1fc155cd07 (diff) | |
download | vyatta-cfg-39d901c16aba8e159d8e250914e744fa74edacd3.tar.gz vyatta-cfg-39d901c16aba8e159d8e250914e744fa74edacd3.zip |
Merge pull request #46 from erkin/current
loadkey: T3506: Remove loadkey
-rw-r--r-- | etc/bash_completion.d/vyatta-cfg | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index b4d6242..da75aa4 100644 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -232,49 +232,15 @@ vyatta_loadsave_complete() vyatta_config_loadkey() { - # don't load if there are uncommitted changes. - if vyatta_cli_shell_api sessionChanged; then - echo "Cannot load: configuration modified." - echo "Commit or discard the changes before loading a config file." - return 1 - fi - # return to top level. - reset_edit_level - ${vyatta_sbindir}/vyatta-load-user-key.pl "$@" + echo "Warning: The obsolete 'loadkey' command has been phased out." + echo "Instead, use the op-mode command 'generate public-key-command' to generate commands for manual addition:" + echo '$ generate public-key-command name <username> path <path-or-url>' + echo } vyatta_loadkey_complete() { - - local restore_shopts=$( shopt -p extglob nullglob | tr \\n \; ) - shopt -s extglob nullglob - - if [[ $COMP_CWORD -eq 0 ]];then - vyatta_config_complete "$@" - eval $restore_shopts - return - fi - - case "$COMP_CWORD" in - 1) if [ -z "${COMP_WORDS[1]}" ]; then - COMPREPLY=( $(getent passwd | awk -F: '$7 == "/bin/vbash" { print $1}') ) - else - COMPREPLY=( $(compgen -u -- ${COMP_WORDS[1]} ) ) - fi ;; - 2) if [ -z "${COMP_WORDS[2]}" ]; then - echo - echo "Possible completions:" - echo -e " <file>\t\t\t\tLoad from file on local machine" - echo -e " scp://<user>@<host>:/<file>\tLoad from file on remote machine" - echo -e " sftp://<user>@<host>/<file>\tLoad from file on remote machine" - echo -e " ftp://<user>@<host>/<file>\tLoad from file on remote machine" - echo -e " http://<host>/<file>\t\t\tLoad from file on remote machine" - echo -e " tftp://<host>/<file>\t\t\tLoad from file on remote machine" - COMPREPLY=( "" " " ) - else - COMPREPLY=( $(compgen -f -- ${COMP_WORDS[2]} ) ) - fi ;; - esac + true } print_commit_log () |