From e8487f3198d91d3c13264ab87a494666af708ae4 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 17 Feb 2002 16:46:11 +0000 Subject: 16662: use parameter expansion instead of grep, sed, and seq. --- ChangeLog | 5 +++++ Completion/Unix/Command/_cdcd | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6313f1e0..0162f9492 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-02-17 Clint Adams + + * 16662: Completion/Unix/Command/_cdcd: use parameter expansion + instead of grep, sed, and seq. + 2002-02-16 Wayne Davison * users/4678: Src/hist.c: Fixed a hard-to-trigger bug in the diff --git a/Completion/Unix/Command/_cdcd b/Completion/Unix/Command/_cdcd index de27724dc..30b165df2 100644 --- a/Completion/Unix/Command/_cdcd +++ b/Completion/Unix/Command/_cdcd @@ -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 () -- cgit 1.4.1