[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-333-g8a5036a

Ville Skyttä ville.skytta at iki.fi
Wed May 25 21:56:37 UTC 2011


The following commit has been merged in the master branch:
commit ea4219a064072577f4b0e18976afbcc1df56ad59
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu May 26 00:36:43 2011 +0300

    strace: Don't try to extract syscall names if they're not going to be used.

diff --git a/completions/strace b/completions/strace
index 0ce473f..4d1f17c 100644
--- a/completions/strace
+++ b/completions/strace
@@ -33,25 +33,25 @@ _strace()
                     prev=${cur/=*/}
                     cur=${cur/*=/}
 
-                    # Import arch-specific syscalls -- not foolproof IMHO
-                    #+                                     --David Paleino
-                    local arch=$(command uname -m)
-                    local syscalls=$(awk '/^#define __NR/ {print $2}' \
-                        /usr/include/asm/unistd.h | sed -e \
-                        's/__NR_//')
-                    if [ -z "$syscalls" ]; then
-                        local unistd
-                        if [[ "$arch" == *86 ]]; then
-                            unistd=/usr/include/asm/unistd_32.h
-                        else
-                            unistd=/usr/include/asm/unistd_64.h
-                        fi
-                        syscalls=$(awk '/^#define __NR/ {print $2}' \
-                            $unistd | sed -e 's/__NR_//')
-                    fi
-
                     case $prev in
                         trace)
+                            # Import arch-specific syscalls
+                            #+ -- not foolproof IMHO --David Paleino
+                            local arch=$(command uname -m)
+                            local syscalls=$(awk '/^#define __NR/ {print $2}' \
+                                /usr/include/asm/unistd.h | sed -e \
+                                's/__NR_//')
+                            if [ -z "$syscalls" ]; then
+                                local unistd
+                                if [[ "$arch" == *86 ]]; then
+                                    unistd=/usr/include/asm/unistd_32.h
+                                else
+                                    unistd=/usr/include/asm/unistd_64.h
+                                fi
+                                syscalls=$(awk '/^#define __NR/ {print $2}' \
+                                    $unistd | sed -e 's/__NR_//')
+                            fi
+
                             COMPREPLY=( $( compgen -W "$syscalls file process
                                 network signal ipc desc all none" -- "$cur") )
                             return 0

-- 
bash-completion



More information about the Bash-completion-commits mailing list