diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-13 12:17:45 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-13 12:17:45 -0700 |
commit | bba82193be7225c078e007c99a1537b68ba68bb1 (patch) | |
tree | 7aefebdcf0650c02355478fd4dc84e53815fa428 /etc/bash_completion.d/20vyatta-cfg | |
parent | c5c35050fca8396968b64f5bffe070ed2b293c32 (diff) | |
parent | 6bbaacf5f0cc1880006a75084539d773eda662ff (diff) | |
download | vyatta-cfg-bba82193be7225c078e007c99a1537b68ba68bb1.tar.gz vyatta-cfg-bba82193be7225c078e007c99a1537b68ba68bb1.zip |
Merge branch 'mendocino' of suva.vyatta.com:/git/vyatta-cfg into mendocino
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 98f26f8..fe21835 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -97,7 +97,22 @@ show () commit () { - if /opt/vyatta/sbin/my_commit "$@"; then + local comment="commit" + local next=0 + local -a args=() + for arg in "$@"; do + if [ "$next" == "1" ]; then + comment=$arg + next=0; + elif [ "$arg" == "comment" ]; then + next=1 + else + args[${#args[@]}]="$arg" + fi + done + args+=("-C '$comment'") + + if /opt/vyatta/sbin/my_commit "${args[@]}"; then vyatta_cli_shell_api markSessionUnsaved fi } @@ -683,11 +698,11 @@ vyatta_config_complete () if ! vyatta_cli_shell_api setupSession; then echo 'Failed to set up config session' - exit 1 + builtin exit 1 fi # disallow 'Ctrl-D' exit, since we need special actions on 'exit' -set -o ignoreeof 1 +builtin set -o ignoreeof 1 reset_edit_level alias set=/opt/vyatta/sbin/my_set |