You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using large fabfiles, one may wish to search for or filter task names. E.g. you know you have some relating to Python but aren't entirely sure and want to do something like fab --list "py*".
Benefit of adding this to -l/--list is that we don't need to consume another flag/letter; but it then makes the helpstring for that option longer. Plus it's a relatively common pattern (empty option defaults to "all", option with an arg limits somehow.)
On the other hand, it would be a simpler implementation to make another dedicated CLI flag, as having "no or one" options requires a callback in optparse (AFAICT anyways.) Plus there is at least some argument for making each individual option relatively simple instead of doubling them up.
Originally submitted by Jeff Forcier (bitprophet) on 2010-01-12 at 01:31pm EST
The text was updated successfully, but these errors were encountered:
optparse doesn't support "optional option arguments" so we can't have a -l option who can a receive an optional pattern to use as a regexp. Anyway, I implemented a new option -L with a required string as argument and uses it as a regexp to filter out the list of commands. It does the job.
Description
When using large fabfiles, one may wish to search for or filter task names. E.g. you know you have some relating to Python but aren't entirely sure and want to do something like
fab --list "py*".Benefit of adding this to
-l/--listis that we don't need to consume another flag/letter; but it then makes the helpstring for that option longer. Plus it's a relatively common pattern (empty option defaults to "all", option with an arg limits somehow.)On the other hand, it would be a simpler implementation to make another dedicated CLI flag, as having "no or one" options requires a callback in
optparse(AFAICT anyways.) Plus there is at least some argument for making each individual option relatively simple instead of doubling them up.Originally submitted by Jeff Forcier (bitprophet) on 2010-01-12 at 01:31pm EST
The text was updated successfully, but these errors were encountered: