summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2005-03-27 00:12:18 +0000
committerClint Adams <clint@users.sourceforge.net>2005-03-27 00:12:18 +0000
commit8b978d2f4efc4a550877e894cb7384c0caaa0cc2 (patch)
treeb874c98df64042af88ac70fa4ecff0ba8e82b2a5
parent21045: fix some uses of Meta characters in completion (diff)
downloadzsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar.gz
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar.bz2
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar.lz
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar.xz
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.tar.zst
zsh-8b978d2f4efc4a550877e894cb7384c0caaa0cc2.zip
20773: Completion/Unix/Command/_getconf: additional variables from confstr().
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_getconf44
2 files changed, 49 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 55901aa0d..24bc32f8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,11 @@
* 20774: Src/exec.c: fix e.g. "FOO=BAR BAR=FOO echo" failure to
unset FOO after finishing.
+2005-02-01 Clint Adams <clint@zsh.org>
+
+ * 20773: Completion/Unix/Command/_getconf: additional variables
+ from confstr().
+
2005-02-01 Peter Stephenson <pws@csr.com>
* Peter A. Castro: 20759 updated as 20760 and 20765: configure.ac,
diff --git a/Completion/Unix/Command/_getconf b/Completion/Unix/Command/_getconf
new file mode 100644
index 000000000..13eb51581
--- /dev/null
+++ b/Completion/Unix/Command/_getconf
@@ -0,0 +1,44 @@
+#compdef getconf
+
+local expl ret=1
+
+if [[ CURRENT -eq 2 ]]; then
+ _tags syswideconfig pathconfig standardsconfig confstring
+
+ while _tags; do
+ _requested -V syswideconfig expl 'systemwide configuration variables' \
+ compadd -S '' ARG_MAX BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX \
+ BC_STRING_MAX CHILD_MAX COLL_WEIGHTS_MAX EXPR_NEST_MAX LINE_MAX \
+ NGROUPS_MAX OPEN_MAX RE_DUP_MAX STREAM_MAX TZNAME_MAX && ret=0
+
+ _requested -V standardsconfig \
+ expl 'system-standards configuration variables' \
+ compadd -S '' _POSIX_CHILD_MAX _POSIX_LINK_MAX \
+ _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX \
+ _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX \
+ _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VERSION \
+ POSIX2_BC_BASE_MAX POSIX2_BC_DIM_MAX POSIX2_BC_SCALE_MAX \
+ POSIX2_BC_STRING_MAX POSIX2_COLL_WEIGHTS_MAX POSIX2_EXPR_NEST_MAX \
+ POSIX2_LINE_MAX POSIX2_RE_DUP_MAX POSIX2_VERSION POSIX2_C_BIND \
+ POSIX2_C_DEV POSIX2_FORT_DEV POSIX2_FORT_RUN POSIX2_LOCALEDEF \
+ POSIX2_SW_DEV _XOPEN_VERSION && ret=0
+
+ _requested -V confstring \
+ expl 'configuration-dependent string variables' \
+ compadd -S '' PATH GNU_LIBC_VERSION GNU_LIBPTHREAD_VERSION \
+ LFS_CFLAGS LFS_LDFLAGS LFS_LIBS LFS_LINTFLAGS \
+ LFS64_CFLAGS LFS64_LDFLAGS LFS64_LIBS LFS64_LINTFLAGS \
+ && ret=0
+
+ _requested pathconfig &&
+ while _next_label -V pathconfig expl 'system path configuration variables'; do
+ compadd "$expl[@]" -S '' PIPE_BUF _POSIX_CHOWN_RESTRICTED \
+ _POSIX_NO_TRUNC _POSIX_VDISABLE && ret=0
+ compadd "$expl[@]" -S ' ' LINK_MAX MAX_CANON MAX_INPUT NAME_MAX \
+ PATH_MAX PIPE_BUF && ret=0
+ done
+ (( ret )) || return 0
+ done
+else
+ _files -/
+fi