Bug 7382 - не дополняет имя цепоски в iptables -E chain
Summary: не дополняет имя цепоски в iptables -E chain
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: bash-completion (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: ildar
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-15 17:46 MSD by Afanasov Dmitry
Modified: 2007-10-17 20:33 MSD (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 в инкоминге.