Unreleased - unreleased
- Fix for support of positionals with dashes in them. They are converted to underscores just like they are for optionals.
5 - 2017-04-10
- Nested pager usage would cause various problems
contrib.Help
now supports deep references to subcommands such ashelp firstlevel secondlevel Nlevel
.
Table(clip=True)
is now controlled by the overflow option, a la.Table(overflow='clip')
.- Refactored VTML -> VTMLBuffer. Bigger API, more features (See Added).
- Changes to arguments produced by
Command.add_table_arguments
:--table-padding
renamed to--column-padding
--table-align
renamed to--column-align
- Support preserving text formatting and width in table columns with
overflow='preformatted'
. - Redesigned help output using Table.
- Support for embedding VTML
'{:vtml}'.format(vtmlbuffer_object)
. Produces a VTML document that can be consumed byvtmlprint
. - Table wrapped column support via
Table(overflow='wrap')
. - VTMLBuffer inplace-add and right-hand add (to strings). Prior to this
in-place add (foo += bar) would produce a new object; Now it extends
the left-operand. The right-hand add adds support for adding VTMLBuffer
to a
str
object, eg.a = 'foo' + VTMLBuffer('bar')
- Added str-like methods to
VTMLBuffer
:startswith
,endswith
,__contains__
andsplit
. - Added textwrap.wrap style text wrapper at
VTMLBuffer.wrap
. - Table
justify
option to turn off full-width usage of screen.
- Command alias support; It never worked properly.
4.3 - 2017-02-25
- Colorization fixes for wrapped help output.
- Red usage output on help.
4.2 - 2017-02-25
- Honor PAGER env var when present.
- Make default pager's search case insensitive.
4.1 - 2017-01-23
- Fix terminal size detection when docker-for-mac bug is detected.
- Added
<i>
italics tag support to VTML. Tested with OSX Terminal and gnome-terminal.
4 - 2017-01-03
- Remove
foo
cruft from default log format in the new log handler. - Cleaner help formatting when doc-strings and help kwargs are omitted.
- Removed double display of defaults when using
autocommand
. - Workaround for flaky term size detection with docker for mac.
- Subcommand support for
env
andautoenv
arguments. - Sanitize autoenv generated env keys.
- Pager support for help output.
- Added contrib.tree command that shows all subcommands.
- Default behavior of subcommand is to print help instead of just usage.
- Make name required at Command construction.
3 - 2016-09-14
- VTML logging handler for converting messages to VTML.
- Environment variable mapping to arguments. Defaults or otherwise all
argument setting can be done for arguments created with
env=NAME
orautoenv=True
. - Colorized
--help
output. - Added default value printing to
--help
output.
- Refactor to put vtml/html/etc into rendering submodule.
- Moved colorized traceback formatting to rendering submodule for public use.
2.4 - 2016-08-17
-
Arguments produced by
Command.
add_file_argument` no longer need to be called when used as context managers. E.g. In older code you would dowith args.my_file_argument() as f: pass
The new argument can be used without the invocation..
with args.my_file_argument as f: pass
- Useful str/repr output for
Command.add_file_argument
values.
2.3 - 2016-08-05
- Docstring parsing of @autocommand commands handles omitted desc lines.
- Use
store_true
action for bool type arguments with @autocommand decorator.
2.2 - 2016-05-08
- Support for setting custom config and history file names instead of
.(name)_config
and.(name)_history
you can override theSession.config_file
andSession.history_file
properties. Combined with settingSession.var_dir
this allows you to store config and history in a sub-folder of the users home dir a la,~/.myapp/config
.
2.1 - 2015-11-16
Command.add_file_argument
provides a factory function instead of a file handle to the args namespace to avoid spontaneously creating files.- Renamed special
command%d
argument used for command specification to__command[%d]__
.
- File argument tab completion works in Python 3.4.
2 - 2015-11-04
- Shell is now Session and does not subclass cmd.Cmd.
--help
is excluded from command tab completion by default. Other args can also be excluded from command completion results by updating theCommand.completion_excludes
set.
treeprint
can now print any standard python data types.- Command exception handling is the same for interactive and non-captive modes.
treeprint
takes afile
argument likevtmlprint
and friends.- Support for INI config files as
.<root>_config
. Also included is anini
contrib command. - Paging support for commands or as a context manager. Set
use_pager
to True on aCommand
to redirect stdout to a pager (usually less). - The
Command
class can now be given prerun, run and postrun functions to be used for the resultant instance. - Added
--no-clip
and--table-width
options toTable
Command
arguments.
vtml.is_terminal
is gone and should be replaced with direct calls to sys.stdout.isatty().
1 - 2015-10-24
- Color tags to VTML
- Argument parsing group for table formats.
- Table is a context manager that calls close when exited.
- CSV, JSON and Markdown table renderers.
- HTML to VTML parser.
- VTML rendering of --help output; Emboldened some elements.
- Better width handling of --help output.
- Renamed dicttree to treeprint.
- treeprint (formerly dicttree) can not print lists and dicts.
- VTML concatenation works with str types now.
- Plain renderer does not clip when shown on terminal.
0.9.0 - 2015-10-08
- The
complete
function ofCommand.add_argument
takes an args variable now, which is a best-effortargparse.Namespace
of the arguments seen at that point in the completion life cycle. - The table calculations for filling unspec columns now takes into consideration the underflow. The leftover characters from underflow are redistributed to all the unspec columns evenly.
- Refactor of
TableRenderer
to be selectable by user and pluggable by developers. You can register newTableRenderer
classes for output formats such as HTML, etc.
- Created
data
module with caching decoratorshone_cache
andttl_cache
.
0.8.0 - 2015-10-02
- Command now takes
title
anddesc
instead ofdoc
argument. - A Command subclass is not required to provide a docstring.
0.7.0 - 2015-10-01
- Support for disabling tab completion padding (adding a space after single matches).
- Tests for tab completion.
- Added Command.postrun() to match existing prerun() hook (with caveat noted below).
- Only run Command.prerun on the instance being 'run()'.
- Change VTML 'UL' tag to just 'U' to match html spec and avoid confusion
- Tab completion does not double-add optional argument keys when they have been satisfied already. This partially worked before with an off-by-1-ish error.
- Cleanup for padding code to not strip argument values which are delimited.
0.6.0 - 2015-09-23
- System wide tab completion support via npm style 'completion' bootstrap command.
0.5.1 - 2015-09-18
- Nothing, just SCM/deploy testing.
0.5.0 - 2015-09-13
- Custom per/user configuration file reader.
- Custom prompt using ^
- Per/column style for table. You can set padding, width, minwidth, and align settings on each column
Command.shell()
renamed to Command.interact()Command.inject_context
accepts a dictionary or kwargs and will cascade new values to subcommands.- Renamed vt prefixes to vtml. ie.
vtprint
->vtmlprint
, etc. - Split out table render state into its own class. The Table class is used to define the config, but at render time a TableRenderer instance is created which holds the calculated state for a table. This renderer state can be passed around and used for rendering/printing more data later.
- Renamed
Table.write
toTable.print
(same forwrite_row
). - Renamed
Table(column_spec=None)
to just columns. Table(column_spec)
is now optional.
- Table handling for vtml strings that overflow.
- Column padding is applied to left and right of the inner data now.
- Column minwidth handling fixed when no clipping was required.
0.4.0 - 2015-09-09
- vtprint hardening (it will degrade quietly when the parser fails).
- Tree printer and convenience dicttree helper function.
- Configurable exception handling for Shell.
0.3.0 - 2015-09-04
- Table support
- vt100 capable printer for bold, underline, etc.
0.2.0 - 2015-08-28
- First stable release