mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
16662: use parameter expansion instead of grep, sed, and seq.
This commit is contained in:
parent
6788acfc73
commit
e8487f3198
@ -1,3 +1,8 @@
|
||||
2002-02-17 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 16662: Completion/Unix/Command/_cdcd: use parameter expansion
|
||||
instead of grep, sed, and seq.
|
||||
|
||||
2002-02-16 Wayne Davison <wayned@users.sourceforge.net>
|
||||
|
||||
* users/4678: Src/hist.c: Fixed a hard-to-trigger bug in the
|
||||
|
@ -4,17 +4,17 @@ typeset -A opt_args
|
||||
|
||||
_cdcd_tracks ()
|
||||
{
|
||||
cdcd info | sed -e 1,2d -e 4d -e "s,Total tracks: *\([0-9]\+\).*,\1,"
|
||||
print ${${${(f)"$(cdcd info)"}[3]}/Total tracks: #(#b)([0-9]##)*/$match[1]}
|
||||
}
|
||||
|
||||
_cdcd_track_list ()
|
||||
{
|
||||
seq 1 $(_cdcd_tracks)
|
||||
print ${1..$(_cdcd_tracks)}
|
||||
}
|
||||
|
||||
_cdcd_track_list_verbose ()
|
||||
{
|
||||
cdcd tracks | grep "^[ 0-9]\+:" | sed -e 's,^ *\([0-9]\+\):[ >]*. *[^ ]* *\(.*\) \+,\1\\\:\"\2\",'
|
||||
print ${${(M)${(f)"$(cdcd tracks)"}:#(#s) #[0-9]##:*}/(#s) #(#b)([0-9]##):[ >]#? #[^ ]# #(*) ##/$match[1]:${(qqq)match[2]}}
|
||||
}
|
||||
|
||||
_cdcd_commands ()
|
||||
|
Loading…
Reference in New Issue
Block a user