summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-10-01 11:37:54 -0700
committerStig Thormodsrud <stig@vyatta.com>2010-10-01 11:37:54 -0700
commit2bbc81ebac9491274bca86865b804705c725e248 (patch)
tree9f05f733a970a6739b72a3e10e27cf16e35e6cbf /etc
parenta1f5b9e22b188f9d081db5a783455f926875c6e6 (diff)
downloadvyatta-cfg-2bbc81ebac9491274bca86865b804705c725e248.tar.gz
vyatta-cfg-2bbc81ebac9491274bca86865b804705c725e248.zip
Pass optional commit comment through commit to commit hooks.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/bash_completion.d/20vyatta-cfg17
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
}