Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
param expansion flags
- X-seq: zsh-users 8781
- From: dom@xxxxxxxxxxxxxxxx (Dominic Mitchell)
- To: zsh-users@xxxxxxxxxx
- Subject: param expansion flags
- Date: Fri, 6 May 2005 13:48:17 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I'm trying to write a completion file rake (a make like thing for ruby).
You can get a list of targets like this:
% rake -sT
rake apidoc # Build the apidoc HTML Files
rake appdoc # Build the appdoc HTML Files
rake clear_logs # Clears all *.log files in log/
And I'm trying to get that lot into an array parameter that looks like
this:
targets=(
'apidoc[Build the apidoc HTML Files]'
'appdoc[Build the appdoc HTML Files]'
'clear_logs[Clears all *.log files in log/]'
)
I've gotten part of the way there, but I can't figure out the rest. So
far, I've gotten it to split out the lines, remove "rake " from the
front and start putting the initial square bracket in.
% arr=( ${${${(f)~~"$(rake -sT)"}#rake }/ *# /[} )
Can anyone offer me some advice?
-Dom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author