diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2010-10-01 11:37:54 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2010-10-01 11:37:54 -0700 |
commit | 2bbc81ebac9491274bca86865b804705c725e248 (patch) | |
tree | 9f05f733a970a6739b72a3e10e27cf16e35e6cbf /etc/bash_completion.d/20vyatta-cfg | |
parent | a1f5b9e22b188f9d081db5a783455f926875c6e6 (diff) | |
download | vyatta-cfg-2bbc81ebac9491274bca86865b804705c725e248.tar.gz vyatta-cfg-2bbc81ebac9491274bca86865b804705c725e248.zip |
Pass optional commit comment through commit to commit hooks.
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 22178e1..070d50f 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 } |