From b046dea74d31d3beb6ababccb96d9cb8411e8ace Mon Sep 17 00:00:00 2001 From: Amjith Ramanujam Date: Sat, 3 Jan 2015 19:36:11 -0800 Subject: [PATCH] Make \? output sorted. --- TODO | 3 ++- pgcli/packages/pgspecial.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 33df44c2..a78769b8 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,8 @@ * [ ] ON keyword should suggest aliases. This is something we don't currently support since a collection of aliases is not maintained. * [ ] Add a page to keep track of changelog in pgcli.com * [ ] Refactor to sqlcompletion to consume the text from left to right and use a state machine to suggest cols or tables instead of relying on hacks. -* [ ] Add a few more special commands. (\l pattern, \di, \dp, \ds, \dv, \dy, \z etc) +* [ ] Add a few more special commands. (\l pattern, \dp, \ds, \dy, \z etc) +* [ ] Refactor pgspecial.py to a class. * [ ] Write a doc about how to add new pgspecial commands.(psql -E) * [ ] Show/hide docs for a statement using a keybinding. * [ ] Check how to add the name of the table before printing the table. diff --git a/pgcli/packages/pgspecial.py b/pgcli/packages/pgspecial.py index 94d1ca79..41d02ec5 100644 --- a/pgcli/packages/pgspecial.py +++ b/pgcli/packages/pgspecial.py @@ -678,7 +678,7 @@ def sql_name_pattern(pattern): def show_help(cur, arg, verbose): # All the parameters are ignored. headers = ['Command', 'Description'] result = [] - for command, value in CASE_SENSITIVE_COMMANDS.iteritems(): + for command, value in sorted(CASE_SENSITIVE_COMMANDS.iteritems()): if value[1]: result.append(value[1]) return [(result, headers, None)]