Table doesn't display well when there are '\r' in prettytable data.
Fixes it by replace '\r\n' with '\n' and '\r' with ' '.
Change-Id: I1fde6d33c211e9629ee0dbeab241eeba20f7b8d5
Closes-bug: #1476929
This change replaces the cliff-tablib json formatter with an internal
replacement. It differs from the tablib formatter in the following ways:
- by default outputs with an indent of 2 spaces. The --noindent formatting
argument outputs with no indentation, to save space or to pipe to tools
which can't handle multi-line input.
- emit_one serialises a simple dict where the column name is the key
and the data item is the value (rather than a list of dicts with
'Field' and 'Value' keys)
The cliff release which contains this change will need a corresponding
cliff-tablib release which removes the json formatter from its setup.py
entry_points.
Change-Id: I7f9b1f339d96ead347a0c9d95ec7004a78d8c9d5
Related-Bug: #1308744
This change replaces the cliff-tablib yaml formatter with an internal
replacement. It differs from the tablib formatter in the following ways:
- always outputs with block formatting rather than the PyYAML default
of deciding based on value content
- emit_one serialises a simple dict where the column name is the key
and the data item is the value (rather than a list of dicts with
'Field' and 'Value' keys)
- emit_one preserves column order by printing a single-item dict for
each column_name
The cliff release which contains this change will need a corresponding
cliff-tablib release which removes the yaml formatter from its setup.py
entry_points.
Change-Id: I691dbab3dee7c5ec28b1083f87ab1f5c051d582b
Related-Bug: #1308744
Help messages are in normally fully sentences starting with a capital
letter, some of the help messages follow this but not all. Adjust all so
that help messages look consistent.
Also, improve wording of --help text.
Change-Id: Ia22ccc42d71a4c9d7085303939dae9948ba52418
The command 'openstack user' throws error with no helpful message even though 'openstack user list' works,
that is really a bad UX. This patch adds fuzzy matching to print the most similar command when user mistypes
the command.
Use Demeraou-Levenshtein algorithm to find the best similarity. It takes experience from Git's
algothrim inplement 8af84dadb1
$ openstack user
openstack: 'user' is not an openstack command. See 'openstack --help'.
Did you mean one of these?
user create
user delete
user list
user password set
user set
user show
consumer create
consumer delete
consumer list
consumer set
consumer show
Change-Id: Id8732504c0b36177319fc33fae7e630b7b714be7
Closes-Bug: 1462192
From lifeless: pbr reflects the package dependencies from
requirements.txt into the sdist that tox builds.
Change-Id: If54f291e4f3f1a05a1b6142e724cbd33110bac1d
This patch changes how cliff handles help for subcommands but only when
'deferred_help' is enabled. Currently cliff consumes --help requests at the top
level. This means `myapp foo --help` and `myapp --help` produce the same output.
To get help for `foo` one must use `myapp help foo`. With this change
`myapp foo --help` will produce the same output as `myapp help foo` by
transforming the --help request into a help subcommand one. This is only done
when there are any options on the command line other than --help. When a top
level --help is requested the original behavior of print_help_if_requested()
is preserved.
Change-Id: I628bbfc383de516045288512cc023213d723a027
Closes-Bug: 1444983
The demo application was creating a new logger instance instead of using
the one built into the base class.
Change-Id: I980b180132cf20f7d2420e8f61e341760674aac0