Bug 7382

Summary: не дополняет имя цепоски в iptables -E chain
Product: Sisyphus Reporter: Afanasov Dmitry <ender>
Component: bash-completionAssignee: ildar <ildar>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: ildar
Version: unstable   
Hardware: all   
OS: Linux   

Description Afanasov Dmitry 2005-07-15 17:46:11 MSD
хотелось бы дополнения для переименования цепочек. конечно пользуется очень 
редко, но иногда приходится :)

далее было бы неплохо дополнения для -N и второго параметра -E - часто цепочки у 
меня следуют одной системе наименования. похожи короче.

время будет - патчик сваяю.
Comment 1 Afanasov Dmitry 2005-08-25 13:11:08 MSD
мда, а вот и патчик:
--- bash_completion.old 2005-08-25 13:03:03 +0400
+++ bash_completion     2005-08-25 13:10:05 +0400
@@ -2895,9 +2895,13 @@
        elif [[ $COMP_LINE == *-t\ *mangle* ]]; then
                table="-t mangle"
        fi
+    
+    if [[ $COMP_LINE == *-E* ]]; then
+        rename=yes
+    fi
 
        case "$prev" in
-       -*[AIDRPFXLZ])
+       -*[AIDRPFXLZEN])
                COMPREPLY=( $( compgen -W '`iptables $table -nL | \
                            sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ) )
                ;;
@@ -2923,7 +2927,10 @@
                fi
                ;;
        *)
-               if [[ "$cur" == -* ]]; then
+        if [[ "$rename" -eq "yes" ]]; then
+                       COMPREPLY=( $( compgen -W '`iptables $table -nL | \
+                           sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ) )
+        elif [[ "$cur" == -* ]]; then
                    COMPREPLY=( $( compgen -W '-i -o -s -d -p -f -m --append \
                    --delete --insert --replace --list --flush --zero --new \
                    --delete-chain --policy --rename-chain --proto --source \
Comment 2 Alex Murygin 2007-10-17 20:33:53 MSD
alt04 в инкоминге.