Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Problem with _arguments
- X-seq: zsh-users 11030
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh-users@xxxxxxxxxx" <zsh-users@xxxxxxxxxx>
- Subject: Re: Problem with _arguments
- Date: Fri, 24 Nov 2006 12:56:21 -0800
- In-reply-to: <dbfc82860611221422p4980d2e8nc3f54716a7a530a0@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <now@xxxxxxxx> <dbfc82860611211457s3a6054d0t947d8054f553e312@xxxxxxxxxxxxxx> <200611212342.kALNg9m7006648@xxxxxxxxxxxxxxxxx> <dbfc82860611220035q30cc7278o87867885d82da92c@xxxxxxxxxxxxxx> <200611221039.kAMAdpal021905@xxxxxxxxxxxxxx> <061122075510.ZM12028@xxxxxxxxxxxxxxxxxxxxxx> <dbfc82860611221422p4980d2e8nc3f54716a7a530a0@xxxxxxxxxxxxxx>
On Nov 22, 2:22pm, Nikolai Weibull wrote:
}
} > Don't forget about compset:
} >
} > -N BEG-PAT [ END-PAT ]
} > If one of the elements of the words array before the one at
} > the index given by the value of the parameter CURRENT matches
} > the pattern BEG-PAT, all elements up to and including the
} > matching one are removed from the words array ...
} >
} > If the optional pattern END-PAT is also given, and there is an
} > element in the words array matching this pattern, the
} > parameters are modified only if the index of this word is
} > higher than the one given by the CURRENT parameter ...
} >
} > So it should work to do something like
} >
} > compset -N '[^-]*'
}
} The problem with this is that it removes arguments to options, that
} is, it'll remove, as I understand it, the 1 to -maxdepth "find src
} -maxdepth 1" causing all sorts of confusion for the _arguments
} function and it won't complete anything after it any more.
Actually in that case it should remove everything up to and including
the "1" so the completion should behave as if there is nothing on the
command line except the command word and the leading part of the word
containing the cursor (assuming it is to the right of the "1") -- plus
anything to the right of the cursor, of course.
As your real usage is considerably more complex than the example you
gave, that's probaby not what you want, but it's also not what you
understood.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author