From 4b8da10215c984daabeca6c6e7d6803b45a4d871 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 1 Jan 2019 13:57:32 +0100 Subject: [PATCH] completions/modinfo: Don't check uname This checks if uname exists (we already call it elsewhere without check, nobody has complained, uname is in POSIX), then calls to see if it's "Linux", and only then offers any completions. Since we don't have any other version to offer, the check is worse than useless. --- share/completions/modinfo.fish | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/share/completions/modinfo.fish b/share/completions/modinfo.fish index 765ab2846..bd59c1509 100644 --- a/share/completions/modinfo.fish +++ b/share/completions/modinfo.fish @@ -1,16 +1,12 @@ -if command -s uname > /dev/null 2>/dev/null - if test (uname) = "Linux" - complete -c modinfo -a "(__fish_print_modules)" - complete -c modinfo -l author -s a -d "Print only 'author'" - complete -c modinfo -l description -s d -d "Print only 'description'" - complete -c modinfo -l license -s l -d "Print only 'license'" - complete -c modinfo -l parameters -s p -d "Print only 'parm'" - complete -c modinfo -l filename -s n -d "Print only 'filename'" - complete -c modinfo -l null -s 0 -d "Use \\0 instead of \\n" - complete -c modinfo -l field -s F -x -d "Print only provided FIELD" -a "author description license parm depends alias intree vermagic vermagic" - complete -c modinfo -l set-version -s k -x -d "Use VERSION instead of `uname -r`" - complete -c modinfo -l basedir -s b -r -d "Use DIR as filesystem root for /lib/modules" - complete -c modinfo -l version -s V -d "Show version" - complete -c modinfo -l help -s h -d "Show help" - end -end +complete -c modinfo -a "(__fish_print_modules)" +complete -c modinfo -l author -s a -d "Print only 'author'" +complete -c modinfo -l description -s d -d "Print only 'description'" +complete -c modinfo -l license -s l -d "Print only 'license'" +complete -c modinfo -l parameters -s p -d "Print only 'parm'" +complete -c modinfo -l filename -s n -d "Print only 'filename'" +complete -c modinfo -l null -s 0 -d "Use \\0 instead of \\n" +complete -c modinfo -l field -s F -x -d "Print only provided FIELD" -a "author description license parm depends alias intree vermagic vermagic" +complete -c modinfo -l set-version -s k -x -d "Use VERSION instead of `uname -r`" +complete -c modinfo -l basedir -s b -r -d "Use DIR as filesystem root for /lib/modules" +complete -c modinfo -l version -s V -d "Show version" +complete -c modinfo -l help -s h -d "Show help"