Command Line Interface Formulation Framework
Go to file
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
cliff Add ability to sort data by columns for list commands 2017-12-27 16:07:45 +02:00
demoapp add before and after hooks 2017-06-30 09:50:21 -04:00
doc Move doc requirements to doc/requirements.txt 2017-12-01 12:35:37 -06:00
integration-tests Add Constraints support 2017-01-04 08:55:06 +11:00
.gitignore Update .gitignore 2017-09-22 02:11:34 +00:00
.gitreview Update .gitreview after repo rename 2014-02-07 20:38:59 +00:00
.stestr.conf Updates for stestr 2017-09-14 16:54:13 -05:00
.testr.conf covert test suite to use testrepository 2017-04-23 10:16:30 -04:00
.travis.yml add pypy test env configuration 2013-09-23 15:45:31 -04:00
.zuul.yaml Replace legacy tips jobs with shiny new versions 2017-12-01 12:35:38 -06:00
CONTRIBUTING.rst Update and replace http with https for doc links 2017-07-21 10:55:01 +08:00
LICENSE change to apache license 2012-04-20 10:06:58 -07:00
MANIFEST.in remove the other traces of distribute 2013-06-11 14:01:31 -04:00
Makefile Correct path to docs 2015-11-12 13:52:05 +00:00
README.rst Update and replace http with https for doc links 2017-07-21 10:55:01 +08:00
bandit.yaml add bandit to pep8 job 2017-11-10 18:14:09 -05:00
openstack-common.conf remove openstack-common.conf 2016-01-15 12:53:44 +08:00
requirements.txt Updated from global requirements 2017-11-16 11:00:37 +00:00
setup.cfg Move doc requirements to doc/requirements.txt 2017-12-01 12:35:37 -06:00
setup.py Updated from global requirements 2017-03-02 11:43:26 +00:00
test-requirements.txt Merge "Move doc requirements to doc/requirements.txt" 2017-12-04 01:39:02 +00:00
tox.ini Remove tox_install.sh and just pass -c in tox 2017-12-02 17:05:45 +00:00

README.rst

Team and repository tags

image

cliff -- Command Line Interface Formulation Framework

cliff is a framework for building command line programs. It uses setuptools entry points to provide subcommands, output formatters, and other extensions.