Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: patchutils completion
- X-seq: zsh-workers 35867
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: patchutils completion
- Date: Thu, 23 Jul 2015 06:48:41 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1437626922; bh=7xKXmNpSfueuV46IBU7jpvR6w/syw3VRQ7iFcG+RjcA=; h=From:To:Subject:Date:From:Subject; b=MA7Y3suuxB5jjQy9LKuuUeS+LV647qUq6AUivlJklCGEXXaSrvc/4YzMuGZswULF/8K6TKLrOEK+eh85ffrWG2lbl7kEz7NzDX4JGO1yQoxXdxDweedDEO0vm/HwYsr9Xb5sr7kHCubTF4ylA0GXtXSNuB3KnVJq3qDrOdbyQBN2xgMeUCZ6QSgBFpJtbrMdzseT3wiEaBmamouGF+GX4096Vrk9s5duWV1zgM1YJlLdpeysmqle9GBQep+CU9jAUv7Sw6wRoCShD3auEw2IAKotMVZ84OpDkP2Gqh7BS6Wn34FmyLqgZEx5eZieJhzlu1L2qYPVrMOxqe7bzjyu4A==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This adds completion for interdiff and friends. Might be useful if
sourceforge goes down again...
Oliver
diff --git a/Completion/Unix/Command/_patchutils b/Completion/Unix/Command/_patchutils
new file mode 100644
index 0000000..323c0a7
--- /dev/null
+++ b/Completion/Unix/Command/_patchutils
@@ -0,0 +1,106 @@
+#compdef combinediff interdiff filterdiff flipdiff grepdiff lsdiff splitdiff unwrapdiff
+
+local args
+args=(
+ '(-)--help[display help information]'
+ '(-)--version[display version information]'
+)
+
+case $service in
+ (inter|combine|filter|flip|ls|grep)diff)
+ args+=(
+ '(-p --strip-match=)'{-p,--strip-match=}'[specify number of path prefix components to strip]:number of path prefix components to strip'
+ '(-z --decompress)'{-z,--decompress}'[decompress .gz and .bz2 files]'
+ )
+ ;|
+ interdiff|combinediff|flipdiff)
+ args+=(
+ '(-q --quiet)'{-q,--quiet}'[quieter output]'
+ '(-U --unified)'{-U,--unified=}'[specify lines of context to include]:lines of context'
+ \*{-d,--drop-context=}"[don't include context on files matching pattern]:pattern:_files"
+ '(-w --ignore-all-space)'{-w,--ignore-all-space}'[ignore all whitespace changes in patches]'
+ '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]'
+ '(-i --ignore-case)'{-i,--ignore-case}'[ignore case differences]'
+ '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of whitespace]'
+ '!(--in-place)--interpolate' '!-h'
+ '!(--no-revert-omitted --in-place)--combinediff'
+ '!(--no-revert-omitted)--flip'
+ '1:diff 1:_files' '2:diff 2:_files'
+ )
+ ;|
+ interdiff)
+ args+=(
+ "--no-revert-omitted[don't revert files changed in only the first patch]"
+ )
+ ;;
+ flipdiff) args+=( '--in-place[write output to original input files]' ) ;;
+ filterdiff|grepdiff|lsdiff)
+ args+=(
+ '(-i --include)'{-i,--include}'[include only files matching pattern]:pattern:_files'
+ '(-x --exclude)'{-x,--exclude}'[exclude files matching pattern]:pattern:_files'
+ '(-# --hunks)'{-#+,--hunks=}'[only list hunks within specified range]:range'
+ '--lines=[only list hunks containing lines within specified range]:range'
+ '(-F --files)'{-F+,--files=}'[only list files within specified range]:range'
+ '--strip=[remove specified number of pathname components before displaying]:components'
+ '--addprefix=[insert specified path prefix before displaying path names]:prefix:_directories'
+ )
+ ;|
+ grepdiff|lsdiff)
+ args+=(
+ '(-n --line-number)'{-n,--line-number}'[show line number at which each patch begins]'
+ '(-N --number-files)'{-N,--number-files}'[show file number before each filename]'
+ '(-s --status)'{-s,--status}'[mark added, modified and removed files]'
+ )
+ ;|
+ lsdiff)
+ args+=(
+ '(-E --empty-files-as-removed)'{-E,--empty-files-as-removed}'[treat empty files as absent]'
+ \*{-v,--verbose}'[verbose operation]'
+ '(-H --with-filename -h --no-filename)'{-H,--with-filename}'[print the name of the patch file containing each patch]'
+ '!--filter' '!--grep'
+ '*:diff file:_files'
+ )
+ ;;
+ grepdiff|filterdiff)
+ args+=(
+ '(-I --include-from-file)'{-I+,--include-from-file=}'[include only files matching pattern listed in specified file]:file:_files'
+ '--annotate[annotate each hunk with the filename and hunk number]'
+ '--format=[use specified output format]:format:(unified context)'
+ '--addnewprefix=[insert specified path prefix before new file path names]:prefix:_directories'
+ '--addoldprefix=[insert specified path prefix before original file path names]:prefix:_directories'
+ '--as-numbered-lines=[display lines of selected hunks]:line numbers:(before after)'
+ "--remove-timestamps[don't include timestamps in output]"
+ )
+ ;;
+ filterdiff)
+ args+=(
+ '(-X --exclude-from-file)'{-X+,--exclude-from-file=}'[exclude files matching any pattern listed in specified file]:file:_files'
+ '(-v --verbose --clean)'{-v,--verbose}'[always show non-diff lines in output]'
+ '(-v --verbose)--clean[always remove all non-diff lines from output]'
+ )
+ ;;
+ grepdiff)
+ args+=(
+ '(-E --extended-regexp)'{-E,--extended-regexp}'[use extended regular expressions]'
+ '(-H --with-filename -h --no-filename)'{-h,--no-filename}"[don't print the name of the patch file containing each patch]"
+ '(-f --file)'{-f+,--file=}'[read regular expressions from file]:file:_files'
+ '--output-matching=[display the matching hunk- or file-level diffs]:level:(hunk file)'
+ )
+ ;;
+ splitdiff)
+ args+=(
+ '-a[split every single file level patch]'
+ '-d[create file names such as a_b.c.patch for a patch that modifies a/b.c]'
+ '-D[write output files into specified directory]:_directories'
+ '-p[specify number of path prefix components to strip]:number of path prefix components to strip'
+ "-E[don't use .patch filename extension when writing output files]"
+ '1:diff file:_files'
+ )
+ ;;
+ unwrapdiff)
+ args+=( '-v[verbose operation]' '*:diff file:_files' )
+ ;;
+esac
+
+_arguments -s $args
+
Messages sorted by:
Reverse Date,
Date,
Thread,
Author