summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-04-23 10:45:47 +0000
committerGitHub <noreply@github.com>2023-04-23 10:45:47 +0000
commit336d6347902605360ea8e52ef1f8eb782d4479cc (patch)
treec990a3687fc5cdef0d35313c6b95d455f1cd0905
parent99db062953e88c26e1b1ae5120b8f8bd9f8d9b90 (diff)
parentc6c2a6569a11cbfc05ac1ed04f58b48bfb0a0557 (diff)
downloadpatchelf-336d6347902605360ea8e52ef1f8eb782d4479cc.tar.gz
Merge #490
490: Fix #310, add zsh completion r=Mic92 a=Freed-Wu Co-authored-by: Wu Zhenyu <wuzhenyu@ustc.edu>
-rw-r--r--Makefile.am3
-rw-r--r--completions/zsh/_patchelf34
2 files changed, 37 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 188f898..1429ad2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,3 +5,6 @@ EXTRA_DIST = COPYING README.md patchelf.spec version $(man1_MANS)
man1_MANS = patchelf.1
doc_DATA = README.md
+
+zshcompletiondir = $(datadir)/zsh/site-functions
+dist_zshcompletion_DATA = completions/zsh/_patchelf
diff --git a/completions/zsh/_patchelf b/completions/zsh/_patchelf
new file mode 100644
index 0000000..c674549
--- /dev/null
+++ b/completions/zsh/_patchelf
@@ -0,0 +1,34 @@
+#compdef patchelf
+
+local options=(
+ '--page-size[Uses the given page size]:SIZE'
+ '--set-interpreter[Change the dynamic loader of executable]:INTERPRETER:dynamic loader:_files'
+ '(- : *)--print-interpreter[Prints the ELF interpreter of the executable]'
+ '(- : *)--print-os-abi[Prints the OS ABI of the executable]'
+ '--set-os-abi[Changes the OS ABI of the executable]:ABI:(none sysv hpux netbsd gnu linux solaris aix irix freebsd tru64 modesto openbsd arm_aeabi arm standalone)'
+ '(- : *)--print-soname[Prints DT_SONAME entry of .dynamic section]'
+ '--set-soname[Sets DT_SONAME entry of a library to SONAME]:SONAME'
+ '--set-rpath[Change the DT_RUNPATH of the executable or library to RUNPATH]:RUNPATH:_dirs'
+ '--remove-rpath[Removes the DT_RPATH or DT_RUNPATH entry of the executable or library]'
+ '--shrink-rpath[Remove from the DT_RUNPATH or DT_RPATH all directories that do not contain a library referenced by DT_NEEDED fields of the executable or library]'
+ '--allowed-rpath-prefixes[Combined with the "--shrink-rpath" option, this can be used for further rpath tuning]:PREFIXES'
+ '(- : *)--print-rpath[Prints the DT_RUNPATH or DT_RPATH for an executable or library]'
+ '--force-rpath[Forces the use of the obsolete DT_RPATH in the file instead of DT_RUNPATH]'
+ '--add-needed[Adds a declared dependency on a dynamic library]:LIBRARY'
+ '*--replace-needed[Replaces a declared dependency on a dynamic library with another one]:a declared dependency:LIB_ORIG:another declared dependency:LIB_NEW'
+ '--remove-needed[Removes a declared dependency on LIBRARY]:LIBRARY'
+ '(- : *)--print-needed[Prints all DT_NEEDED entries of the executable]'
+ '--no-default-lib[Marks the object so that the search for dependencies of this object will ignore any default library search paths]'
+ '--no-sort[Do not sort program headers or section headers]'
+ '--add-debug-tag[Adds DT_DEBUG tag to the .dynamic section if not yet present in an ELF object]'
+ '(- : *)--print-execstack[Prints the state of the executable flag of the GNU_STACK program header, if present]'
+ '--clear-execstack[Clears the executable flag of the GNU_STACK program header, or adds a new header]'
+ '--set-execstack[Sets the executable flag of the GNU_STACK program header, or adds a new header]'
+ '--rename-dynamic-symbols[Renames dynamic symbols]:NAME_MAP_FILE'
+ '--output[Set the output file name]:FILE:_files'
+ '--debug[Prints details of the changes made to the input file]'
+ '--version[Shows the version of patchelf]'
+ "(- : *)"{-h,--help}'[Show list of command-line options]'
+)
+
+_arguments -s -S $options '*: :_files'