From e5d1d0b354ab8ebe16b4f78aadec91ed861fd04c Mon Sep 17 00:00:00 2001 From: Carsten Hey Date: Mon, 15 Mar 2010 00:05:34 +0100 Subject: [PATCH] zshrc: add default values to changed() and new() Make changed() and new() display files changed/modified within the last day if no argument was given Signed-off-by: Carsten Hey --- doc/grmlzshrc.t2t | 6 ++++-- etc/zsh/zshrc | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index 1837a98..2e879c3 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -458,7 +458,8 @@ cdrecord. : **changed()** Lists files in current directory, which have been changed within the -last N days. N is an integer required as first and only argument. +last N days. N is an integer to be passed as first and only argument. +If no argument is specified N is set to 1. : **check_com()** Returns true if given command exists either as program, function, alias, @@ -655,7 +656,8 @@ a clean deinstall later. : **new()** Lists files in current directory, which have been modified within the -last N days. N is an integer required as first and only argument. +last N days. N is an integer to be passed as first and only argument. +If no argument is specified N is set to 1. : **ogg2mp3_192()** Recodes an ogg file to mp3 with a bitrate of 192. diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 04645d7..d8bb453 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3496,16 +3496,16 @@ regcheck() { pcre_match $2 && echo "regex matches" || echo "regex does not match" } -#f5# List files which have been changed within the last {\it n} days +#f5# List files which have been changed within the last {\it n} days, {\it n} defaults to 1 changed() { emulate -L zsh - print -l *(c-$1) + print -l *(c-${1:1}) } -#f5# List files which have been modified within the last {\it n} days +#f5# List files which have been modified within the last {\it n} days, {\it n} defaults to 1 new() { emulate -L zsh - print -l *(m-$1) + print -l *(m-${1:1}) } #f5# Grep in history -- 2.1.4