diff options
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r-- | alot/commands/globals.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 6c73e6c9..5304b32d 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -28,6 +28,7 @@ from ..completion.commandline import CommandLineCompleter from ..completion.contacts import ContactsCompleter from ..completion.accounts import AccountCompleter from ..completion.tags import TagsCompleter +from ..db.sort import NAME as SORT_NAME from ..widgets.utils import DialogBox from ..mail.envelope import Envelope from ..settings.const import settings @@ -77,8 +78,7 @@ class ExitCommand(Command): ui.exit() @registerCommand(MODE, 'search', usage='search query', arguments=[ - (['--sort'], {'help': 'sort order', 'choices': [ - 'oldest_first', 'newest_first', 'message_id', 'unsorted']}), + (['--sort'], {'help': 'sort order', 'choices': list(SORT_NAME.keys())}), (['query'], {'nargs': argparse.REMAINDER, 'help': 'search string'})]) class SearchCommand(Command): @@ -96,7 +96,7 @@ class SearchCommand(Command): :type sort: str """ self.query = ' '.join(query) - self.order = sort + self.order = SORT_NAME[sort] if sort else None super().__init__(**kwargs) def apply(self, ui): |