diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2013-10-26 17:53:15 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2013-10-30 20:48:45 +0000 |
commit | 454afb261595bbc4e6bf0f9c1aa882be78648541 (patch) | |
tree | 188794dde33aac0ceb620506130b20d769957ab2 /alot | |
parent | 7037fc2348bdfec49331afe800804f1b9b45eac6 (diff) |
add --tags option to global taglist command
that sets a whitelist of tag strings to be displayed
cf issue #662
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 03c9aaa6..21b14afc 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -479,20 +479,23 @@ class OpenBufferlistCommand(Command): ui.buffer_open(bl) -@registerCommand(MODE, 'taglist') +@registerCommand(MODE, 'taglist', arguments=[ + (['--tags'], {'nargs': '+', 'help': 'tags to display'}), +]) class TagListCommand(Command): """opens taglist buffer""" - def __init__(self, filtfun=None, **kwargs): + def __init__(self, filtfun=None, tags=None, **kwargs): """ :param filtfun: filter to apply to displayed list :type filtfun: callable (str->bool) """ self.filtfun = filtfun + self.tags = tags Command.__init__(self, **kwargs) def apply(self, ui): - tags = ui.dbman.get_all_tags() + tags = self.tags or ui.dbman.get_all_tags() blists = ui.get_buffers_of_type(buffers.TagListBuffer) if blists: buf = blists[0] |