cliff/cliff
Vitalii Kulanov 21914ed74b Add ability to sort data by columns for list commands
Very often there is a need to sort data by one or several
columns. This patch adds ability to do this by specifying
extra '-s/--sort-column' argument with respective columns:

  -s SORT_COLUMN, --sort-column SORT_COLUMN
                        specify the column(s) to sort the data
                        (columns specified first have a priority,
                        non-existing columns are ignored), can be
                        repeated

e.g.:

 * without sorting:

   foo_command bar_subcommand list
   +------+------+
   | Col1 | Col2 |
   +------+------+
   | a    | A    |
   | b    | B    |
   | c    | A    |
   +------+------+

 * with sorting:
   foo_command bar_subcommand list -s Col2 Col1
   +------+------+
   | Col1 | Col2 |
   +------+------+
   | a    | A    |
   | c    | A    |
   | b    | B    |
   +------+------+

Change-Id: Ifc6d6746448ff6f42898efd78ed3fd084a598a91
2017-12-27 16:07:45 +02:00
..
formatters Fix codec error when format=csv 2017-10-02 19:44:14 -04:00
tests Add ability to sort data by columns for list commands 2017-12-27 16:07:45 +02:00
__init__.py add setup.py and package directory 2012-04-20 09:52:55 -07:00
_argparse.py Ensure python standard argparse module is loaded 2017-05-20 02:16:34 +09:00
app.py Fix codec error when format=csv 2017-10-02 19:44:14 -04:00
columns.py Add Apache 2.0 license to source file 2016-10-10 13:43:09 +07:00
command.py handle more varied top_level.txt files in distributions 2017-09-26 17:17:08 -04:00
commandmanager.py add support for legacy command name translation 2017-11-30 12:01:25 -05:00
complete.py add cmd_name argument to CompleteCommand 2017-05-25 18:38:58 -04:00
display.py Add ability to sort data by columns for list commands 2017-12-27 16:07:45 +02:00
help.py show the distribution providing the command in help output 2017-09-22 14:35:29 +00:00
hooks.py Docs update for more-hooks 2017-09-16 13:05:19 -05:00
interactive.py Alias exit to cmd2's quit command to exit interactive shell 2017-08-23 09:22:58 -07:00
lister.py Add ability to sort data by columns for list commands 2017-12-27 16:07:45 +02:00
show.py Add Apache 2.0 license to source file 2016-10-10 13:43:09 +07:00
sphinxext.py sphinxext: Support cliff application 2017-10-30 20:38:26 +00:00
utils.py Fix codec error when format=csv 2017-10-02 19:44:14 -04:00