diff options
| author | Clint Adams <clint@users.sourceforge.net> | 2002-02-17 16:46:11 +0000 |
|---|---|---|
| committer | Clint Adams <clint@users.sourceforge.net> | 2002-02-17 16:46:11 +0000 |
| commit | e8487f3198d91d3c13264ab87a494666af708ae4 (patch) | |
| tree | 2dda1aa463a10276e1b6f8c8189b12f435e03b47 /Completion/Unix/Command/_cdcd | |
| parent | users/4678 (diff) | |
| download | zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar.gz zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar.bz2 zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar.lz zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar.xz zsh-e8487f3198d91d3c13264ab87a494666af708ae4.tar.zst zsh-e8487f3198d91d3c13264ab87a494666af708ae4.zip | |
16662: use parameter expansion instead of grep, sed, and seq.
Diffstat (limited to 'Completion/Unix/Command/_cdcd')
| -rw-r--r-- | Completion/Unix/Command/_cdcd | 6 |
1 files changed, 3 insertions, 3 deletions
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 () |
