From 2bbc81ebac9491274bca86865b804705c725e248 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Fri, 1 Oct 2010 11:37:54 -0700 Subject: Pass optional commit comment through commit to commit hooks. --- etc/bash_completion.d/20vyatta-cfg | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'etc') 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 } -- cgit v1.2.3