* [patch] Add BSDs to _ldconfig
@ 2018-01-07 4:35 Matthew Martin
2018-01-07 5:53 ` Eitan Adler
2018-01-07 6:59 ` Matthew Martin
0 siblings, 2 replies; 3+ messages in thread
From: Matthew Martin @ 2018-01-07 4:35 UTC (permalink / raw)
To: zsh-workers
Move _ldconfig to Unix and add [DFNO]BSD to the mix. Thanks to Dana for
review.
- Matthew Martin
diff --git a/Completion/Linux/Command/_ldconfig b/Completion/Linux/Command/_ldconfig
deleted file mode 100644
index 5f4802f91..000000000
--- a/Completion/Linux/Command/_ldconfig
+++ /dev/null
@@ -1,35 +0,0 @@
-#compdef ldconfig ldconfig.real
-
-local ret=1
-local -a context line state state_descr
-local -A opt_args
-
-_arguments -s -S : \
- '(x -v --verbose)'{-v,--verbose}'[output verbosely]' \
- '(x)*: :->files' \
- + x \
- '(: -)'{-\?,--help}'[display help information]' \
- '(: -)'{-p,--print-cache}'[display libraries in current cache]' \
- '(: -)--usage[display brief usage information]' \
- '(: -)'{-V,--version}'[display version information]' \
- + l \
- '(x o)-l[manually link individual libraries (library mode)]' \
- + o \
- '(x l -c --format)'{-c+,--format=}'[specify cache format]:cache format:(old new compat)' \
- '(x l)-C+[specify cache file to use instead of /etc/ld.so.cache]:cache file:_files' \
- '(x l)-f+[specify configuration file to use instead of /etc/ld.so.conf]:configuration file:_files' \
- '(x l -i --ignore-aux-cache)'{-i,--ignore-aux-cache}'[ignore auxiliary cache file]' \
- '(x l -N)-n[process only directories specified on command line (implies -N)]' \
- '(x l)-N[do not rebuild cache]' \
- '(x l)-r+[specify root directory]:root directory:_directories' \
- '(x l)-X[do not update symbolic links]' \
-&& ret=0
-
-[[ $state == files ]] &&
-if [[ -n ${opt_args[(I)l--l]} ]]; then
- _object_files && ret=0
-else
- _directories && ret=0
-fi
-
-return ret
diff --git a/Completion/Unix/Command/_ldconfig b/Completion/Unix/Command/_ldconfig
new file mode 100644
index 000000000..d9f0b5eac
--- /dev/null
+++ b/Completion/Unix/Command/_ldconfig
@@ -0,0 +1,82 @@
+#compdef ldconfig ldconfig.real
+
+local ret=1
+local -a args context line state state_descr
+local -A opt_args
+
+case $OSTYPE in
+ linux*)
+ args=(
+ '(x -v --verbose)'{-v,--verbose}'[output verbosely]' \
+ + x \
+ '(: -)'{-\?,--help}'[display help information]'
+ '(: -)'{-p,--print-cache}'[display libraries in current cache]'
+ '(: -)--usage[display brief usage information]'
+ '(: -)'{-V,--version}'[display version information]'
+ + l
+ '(x o)-l[manually link individual libraries (library mode)]'
+ + o
+ '(x l -c --format)'{-c+,--format=}'[specify cache format]:cache format:(old new compat)'
+ '(x l)-C+[specify cache file to use instead of /etc/ld.so.cache]:cache file:_files'
+ '(x l)-f+[specify configuration file to use instead of /etc/ld.so.conf]:configuration file:_files'
+ '(x l -i --ignore-aux-cache)'{-i,--ignore-aux-cache}'[ignore auxiliary cache file]'
+ '(x l -N)-n[process only directories specified on command line (implies -N)]'
+ '(x l)-N[do not rebuild cache]'
+ '(x l)-r+[specify root directory]:root directory:_directories'
+ '(x l)-X[do not update symbolic links]'
+ )
+ ;;
+ *bsd*|dragonfly*)
+ args=(
+ '(-U)-m[merge into the existing hints file]'
+ '(: -)-r[list the current contents of the hints file]'
+ );|
+ dragonfly*|freebsd*|openbsd*)
+ args+=(
+ '(-U)-R[rescan previously configured directories]'
+ );|
+ dragonfly*|freebsd*)
+ args+=(
+ '(-aout)-elf[generate hints for elf format shared libraries]'
+ '-f+[specify hints file]:hints file:_files'
+ '-i[run in insecure mode]'
+ );|
+ freebsd*|netbsd*|openbsd*)
+ args+=(
+ '-v[switch on verbose mode]'
+ );|
+ freebsd*|openbsd*)
+ args+=(
+ '-s[do not scan /usr/lib for shared libraries]'
+ '-v[switch on verbose mode]'
+ );|
+ freebsd*)
+ args+=(
+ '-32[generate hints for 32-bit ABI shared libraries]'
+ '(-elf)-aout[generate hints for a.out format shared libraries]'
+ );|
+ netbsd*)
+ args+=(
+ '(-s)-c[do not scan directories in /etc/ls.so.conf]'
+ '(-s)-S[do not scan /usr/lib for shared libraries]'
+ '-s[do not scan /usr/lib or directories in /etc/ld.so.conf for shared libraries]'
+ );|
+ openbsd*)
+ args+=(
+ '(-m)-U[unconfigure specified directories or inaccessable directories if none specified]'
+ );|
+esac
+
+_arguments -s -S : \
+ '(x)*: :->files' \
+ $args \
+&& ret=0
+
+[[ $state == files ]] &&
+if [[ -n ${opt_args[(I)l--l]} ]]; then
+ _object_files && ret=0
+else
+ _directories && ret=0
+fi
+
+return ret
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Add BSDs to _ldconfig
2018-01-07 4:35 [patch] Add BSDs to _ldconfig Matthew Martin
@ 2018-01-07 5:53 ` Eitan Adler
2018-01-07 6:59 ` Matthew Martin
1 sibling, 0 replies; 3+ messages in thread
From: Eitan Adler @ 2018-01-07 5:53 UTC (permalink / raw)
To: Zsh hackers list
On 6 January 2018 at 20:35, Matthew Martin <phy1729@gmail.com> wrote:
> Move _ldconfig to Unix and add [DFNO]BSD to the mix. Thanks to Dana for
> review.
nice! thanks!
--
Eitan Adler
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] Add BSDs to _ldconfig
2018-01-07 4:35 [patch] Add BSDs to _ldconfig Matthew Martin
2018-01-07 5:53 ` Eitan Adler
@ 2018-01-07 6:59 ` Matthew Martin
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Martin @ 2018-01-07 6:59 UTC (permalink / raw)
To: zsh-workers
On Sat, Jan 06, 2018 at 10:35:36PM -0600, Matthew Martin wrote:
> Move _ldconfig to Unix and add [DFNO]BSD to the mix. Thanks to Dana for
> review.
>
> - Matthew Martin
Accidentally included -v twice.
diff --git a/Completion/Linux/Command/_ldconfig b/Completion/Linux/Command/_ldconfig
deleted file mode 100644
index 5f4802f91..000000000
--- a/Completion/Linux/Command/_ldconfig
+++ /dev/null
@@ -1,35 +0,0 @@
-#compdef ldconfig ldconfig.real
-
-local ret=1
-local -a context line state state_descr
-local -A opt_args
-
-_arguments -s -S : \
- '(x -v --verbose)'{-v,--verbose}'[output verbosely]' \
- '(x)*: :->files' \
- + x \
- '(: -)'{-\?,--help}'[display help information]' \
- '(: -)'{-p,--print-cache}'[display libraries in current cache]' \
- '(: -)--usage[display brief usage information]' \
- '(: -)'{-V,--version}'[display version information]' \
- + l \
- '(x o)-l[manually link individual libraries (library mode)]' \
- + o \
- '(x l -c --format)'{-c+,--format=}'[specify cache format]:cache format:(old new compat)' \
- '(x l)-C+[specify cache file to use instead of /etc/ld.so.cache]:cache file:_files' \
- '(x l)-f+[specify configuration file to use instead of /etc/ld.so.conf]:configuration file:_files' \
- '(x l -i --ignore-aux-cache)'{-i,--ignore-aux-cache}'[ignore auxiliary cache file]' \
- '(x l -N)-n[process only directories specified on command line (implies -N)]' \
- '(x l)-N[do not rebuild cache]' \
- '(x l)-r+[specify root directory]:root directory:_directories' \
- '(x l)-X[do not update symbolic links]' \
-&& ret=0
-
-[[ $state == files ]] &&
-if [[ -n ${opt_args[(I)l--l]} ]]; then
- _object_files && ret=0
-else
- _directories && ret=0
-fi
-
-return ret
diff --git a/Completion/Unix/Command/_ldconfig b/Completion/Unix/Command/_ldconfig
new file mode 100644
index 000000000..3c3fca538
--- /dev/null
+++ b/Completion/Unix/Command/_ldconfig
@@ -0,0 +1,81 @@
+#compdef ldconfig ldconfig.real
+
+local ret=1
+local -a args context line state state_descr
+local -A opt_args
+
+case $OSTYPE in
+ linux*)
+ args=(
+ '(x -v --verbose)'{-v,--verbose}'[output verbosely]' \
+ + x \
+ '(: -)'{-\?,--help}'[display help information]'
+ '(: -)'{-p,--print-cache}'[display libraries in current cache]'
+ '(: -)--usage[display brief usage information]'
+ '(: -)'{-V,--version}'[display version information]'
+ + l
+ '(x o)-l[manually link individual libraries (library mode)]'
+ + o
+ '(x l -c --format)'{-c+,--format=}'[specify cache format]:cache format:(old new compat)'
+ '(x l)-C+[specify cache file to use instead of /etc/ld.so.cache]:cache file:_files'
+ '(x l)-f+[specify configuration file to use instead of /etc/ld.so.conf]:configuration file:_files'
+ '(x l -i --ignore-aux-cache)'{-i,--ignore-aux-cache}'[ignore auxiliary cache file]'
+ '(x l -N)-n[process only directories specified on command line (implies -N)]'
+ '(x l)-N[do not rebuild cache]'
+ '(x l)-r+[specify root directory]:root directory:_directories'
+ '(x l)-X[do not update symbolic links]'
+ )
+ ;;
+ *bsd*|dragonfly*)
+ args=(
+ '(-U)-m[merge into the existing hints file]'
+ '(: -)-r[list the current contents of the hints file]'
+ );|
+ dragonfly*|freebsd*|openbsd*)
+ args+=(
+ '(-U)-R[rescan previously configured directories]'
+ );|
+ dragonfly*|freebsd*)
+ args+=(
+ '(-aout)-elf[generate hints for elf format shared libraries]'
+ '-f+[specify hints file]:hints file:_files'
+ '-i[run in insecure mode]'
+ );|
+ freebsd*|netbsd*|openbsd*)
+ args+=(
+ '-v[switch on verbose mode]'
+ );|
+ freebsd*|openbsd*)
+ args+=(
+ '-s[do not scan /usr/lib for shared libraries]'
+ );|
+ freebsd*)
+ args+=(
+ '-32[generate hints for 32-bit ABI shared libraries]'
+ '(-elf)-aout[generate hints for a.out format shared libraries]'
+ );|
+ netbsd*)
+ args+=(
+ '(-s)-c[do not scan directories in /etc/ls.so.conf]'
+ '(-s)-S[do not scan /usr/lib for shared libraries]'
+ '-s[do not scan /usr/lib or directories in /etc/ld.so.conf for shared libraries]'
+ );|
+ openbsd*)
+ args+=(
+ '(-m)-U[unconfigure specified directories or inaccessable directories if none specified]'
+ );|
+esac
+
+_arguments -s -S : \
+ '(x)*: :->files' \
+ $args \
+&& ret=0
+
+[[ $state == files ]] &&
+if [[ -n ${opt_args[(I)l--l]} ]]; then
+ _object_files && ret=0
+else
+ _directories && ret=0
+fi
+
+return ret
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-07 6:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-07 4:35 [patch] Add BSDs to _ldconfig Matthew Martin
2018-01-07 5:53 ` Eitan Adler
2018-01-07 6:59 ` Matthew Martin
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).