about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-10-08 11:37:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-10-08 11:37:34 +0000
commit612cec047f7726f5b5f974b365894de4a58aef78 (patch)
tree635fdab2765c00d37f3c796710231e6c6bd41482
parent7e86f2da31ec41931f6fb524854d5baf6143062a (diff)
downloadzsh-612cec047f7726f5b5f974b365894de4a58aef78.tar.gz
zsh-612cec047f7726f5b5f974b365894de4a58aef78.tar.xz
zsh-612cec047f7726f5b5f974b365894de4a58aef78.zip
Nikolai Weibull: 25828: new rm completion
unposted: note some new features in NEWS
-rw-r--r--ChangeLog7
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_rm41
-rw-r--r--NEWS10
4 files changed, 58 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a105ed2b7..bff66fa2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-08  Peter Stephenson  <pws@csr.com>
+
+	* Nikolai Weibull: 25828: Completion/Unix/Command/_rm,
+	Completion/Unix/Command/.distfiles: new completion.
+
+	* unposted: NEWS: note some new features.
+
 2008-10-07  Clint Adams  <clint@zsh.org>
 
 	* 25823: Functions/Misc/run-help: bring up zshcontrib man page if
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index c8d935bd5..2a96ad6b1 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -164,6 +164,7 @@ _rcs
 _renice
 _ri
 _rlogin
+_rm
 _rrdtool
 _rsync
 _rubber
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
new file mode 100644
index 000000000..4209134b0
--- /dev/null
+++ b/Completion/Unix/Command/_rm
@@ -0,0 +1,41 @@
+#compdef rm
+
+declare -a opts args
+args=(
+  '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
+  '(-I --interactive)-i[prompt before every removal]'
+  '(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]'
+  '*:files:->file'
+)
+if _pick_variant gnu=gnu unix --help; then
+  opts+=(-S)
+  args+=(
+    '(-i --interactive)-I[prompt when removing many files]'
+    '(-i -I)--interactive=-[prompt under given condition (defaulting to always)]::when:((once\:"prompt when removing many files"
+                                                                                         always\:"prompt before every removal"))'
+    '--one-file-system[stay within filesystems of files given as arguments]'
+    '(                   --preserve-root)--no-preserve-root[do not treat / specially]'
+    '(--no-preserve-root                )--preserve-root[do not remove / (default)]'
+    '(-v --verbose)'{-v,--verbose}'[explain what is being done]'
+    '(- *)--help[display help message and exit]'
+    '(- *)--version[output version information and exit]'
+  )
+else
+  args=(${args:#*--(force|recursive)\[*})
+fi
+
+local curcontext=$curcontext state line ret=1
+declare -A opt_args
+
+_arguments -C $opts \
+  $args && ret=0
+
+case $state in
+  (file)
+    declare -a ignored
+    ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+    _path_files -F ignored && ret=0
+    ;;
+esac
+
+return $ret
diff --git a/NEWS b/NEWS
index 01b44bc12..cdea0a127 100644
--- a/NEWS
+++ b/NEWS
@@ -11,12 +11,20 @@ The option COMBINING_CHARS has been added.  When it is set, the
 line editor assumes the terminal is capable of displaying zero-width
 combining characters (typically accents) correctly as modifications
 to the base character, and will act accordingly.  Note it is not set
-by default owing to vagaries of terminals.
+by default owing to vagaries of terminals.  The system is reported
+to work on MacOS, where this is particularly important as accented
+characters in file names are stored in their decomposed form (i.e.
+with base and combining characters).
 
 The option HIST_FCNTL_LOCK has been added to provide locking of history
 files using the system call fcntl().  On recent NFS implementations this
 may provide better reliability.
 
+The syntax ~[...] provides a dynamic form of directory naming,
+supplementing the existing static ~name syntax.  A user-defined shell
+function, zsh_directory_name, is used to handle both expansion of names to
+directories and contraction of directories to names.
+
 Patterns can now be used in incremental searches with the new widgets
 history-incremental-pattern-search-backward and
 history-incremental-pattern-search-forward.  These are not bound to