* [PATCH] Completion/Unix/_strip
@ 2007-11-01 8:52 Nikolai Weibull
2007-11-05 22:21 ` Nikolai Weibull
2007-11-11 2:56 ` Clint Adams
0 siblings, 2 replies; 3+ messages in thread
From: Nikolai Weibull @ 2007-11-01 8:52 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
This patch expands strip's completion with arguments suited for Solaris and GNU.
Clint: do you have any suggestions on how to submit patches like this
one, based on the Git repository, to the list?
[-- Attachment #2: _strip.patch --]
[-- Type: application/octet-stream, Size: 2699 bytes --]
diff --git a/Completion/Unix/Command/_strip b/Completion/Unix/Command/_strip
index d7d8aab..06f7243 100644
--- a/Completion/Unix/Command/_strip
+++ b/Completion/Unix/Command/_strip
@@ -1,6 +1,60 @@
#compdef strip
-local expl
+local curcontext=$curcontext state line ret=0
+declare -A opt_args
+declare -a args
-_description files expl executable
-_files "$expl[@]" -g '*(-*)'
+if _pick_variant gnu=GNU solaris --version; then
+ if [[ -prefix @* ]]; then
+ compset -P '@'
+
+ local expl
+
+ _description files expl 'command-line-options file'
+ _files $expl && ret=0
+ return $ret
+ fi
+ args=(
+ '(-F --target)'{-F+,--target=}'[object code format to use]:bfd name:->bfdnames'
+ '--help[display usage information and exit]'
+ '--info[display list of architectures and object formats]'
+ '(-I --input-target)'{-I+,--input-target=}'[object code format of input]:bfd name:->bfdnames'
+ '(-O --output-target)'{-I+,--output-target=}'[object code format of output]:bfd name:->bfdnames'
+ '*'{-R+,--remove-section=}'[remove given sections]:section name'
+ '(-s --strip-all)'{-s,--strip-all}'[remove all symbols]'
+ '(-g -S -d --strip-debug)'{-g,-S,-d,--strip-debug}'[remove debugging symbols]'
+ '--strip-unneeded[remove symbols not needed for relocation processing]'
+ '*'{-K+,--keep-symbol=}'[keep given symbol]:symbol name'
+ '*'{-N+,--strip-symbol=}'[strip given symbol]:symbol name'
+ '(*)-o+[output file]:output file:_files'
+ '(-p --preserve-dates)'{-p,--preserve-dates}'[preserve access and modification dates]'
+ '(-w --wildcard)'{-w,--wildcard}'[permit wilcards in symbol names]'
+ '(-x --discard-all)'{-x,--discard-all}'[remove non-global symbols]'
+ '(-X --discard-locals)'{-X,--discard-locals}'[remove compiler-generated local symbols]'
+ '--keep-file-symbols[retain symbols specifying source file names]'
+ '--only-keep-debug[remove everything except debugging information]'
+ '(-V --version)'{-V,--version}'[display version information and exit]'
+ '(-v --verbose)'{-v,--verbose}'[list all object files modified or members of archives]')
+else
+ args=(
+ '-l[strip line information only]'
+ '-V[display version information on stderr and exit]'
+ '-x[do not strip the symbol table]')
+fi
+
+_arguments \
+ $args \
+ '1:executable:_files -g "*(-*)"' \
+ '*::executable:_files -g "*(-*)"' && ret=0
+
+case $state in
+ (bfdnames)
+ local expl
+ declare -a bfdnames
+
+ bfdnames=(${=${(M)${(f)"$(_call_program bfdnames strip --help 2>/dev/null)"}:#strip: supported targets: *}#strip: supported targets: })
+ _describe -t bfdnames 'bfd name' bfdnames && ret=0
+ ;;
+esac
+
+return $ret
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Completion/Unix/_strip
2007-11-01 8:52 [PATCH] Completion/Unix/_strip Nikolai Weibull
@ 2007-11-05 22:21 ` Nikolai Weibull
2007-11-11 2:56 ` Clint Adams
1 sibling, 0 replies; 3+ messages in thread
From: Nikolai Weibull @ 2007-11-05 22:21 UTC (permalink / raw)
To: zsh-workers
On 11/1/07, Nikolai Weibull <now@bitwi.se> wrote:
> This patch expands strip's completion with arguments suited for Solaris and GNU.
Did this get lost in all the zcurses patches?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Completion/Unix/_strip
2007-11-01 8:52 [PATCH] Completion/Unix/_strip Nikolai Weibull
2007-11-05 22:21 ` Nikolai Weibull
@ 2007-11-11 2:56 ` Clint Adams
1 sibling, 0 replies; 3+ messages in thread
From: Clint Adams @ 2007-11-11 2:56 UTC (permalink / raw)
To: Nikolai Weibull; +Cc: zsh-workers
On Thu, Nov 01, 2007 at 09:52:18AM +0100, Nikolai Weibull wrote:
> This patch expands strip's completion with arguments suited for Solaris and GNU.
Committed.
> Clint: do you have any suggestions on how to submit patches like this
> one, based on the Git repository, to the list?
Not that I can think of.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-11 2:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-01 8:52 [PATCH] Completion/Unix/_strip Nikolai Weibull
2007-11-05 22:21 ` Nikolai Weibull
2007-11-11 2:56 ` Clint Adams
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).