summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/20vyatta-cfg
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-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
}