Package: kmd
Overviewkmdallows to build command line driven shells
with powerful tab-completion capabilities.The kmd.Kmd class derives fromcmd.Cmdand extends it in the
following ways:Instead of Python’sreadlinemodule, kmd.Kmd uses the alternativerlreadline bindings.Setup and tear-down of the readline completer have been moved topreloopandpostlooprespectively. Subclasses must make sure to call their
parents’ implementations.Incomplete command names are automatically expanded if they are unique.Command aliases can be defined by extending thealiasesdictionary.
Alias names apply to alldo_,complete_, andhelp_attributes.Lines starting with ‘#’ are treated as comments. The newcommentmethod
is invoked, receiving the line as argument.It is now possible to configure theshell_escape_chars.
The default is ‘!’.If ahistory_fileis set, kmd.Kmd loads and saves the history
inpreloopandpostloop.The newrunmethod encapsulates the full execution cycle of a Kmd.Package Contentskmd.KmdImplements the mechanics of a command shell, based oncmd.Cmd.kmd.completionsImplements a set of ready-to-use completions.kmg.quotingDefines constants and functions for writing completions.DocumentationFor further details please refer to theAPI Documentation.Developmentkmd development is hosted onGitHubwhere it also has anissue tracker.InstallationInstallation requires Python 2.7 or higher.Note: kmd uses therllibrary which contains a C extension. It is a good idea
to review itsinstallation instructionsand make sure all dependencies are
in place.To install thekmdpackage, type:pip install kmdChangelog2.4 - 2022-11-17Upgrade to rl 3.1.
[stefan]Update filename completion for readline 8.2.
[stefan]Hide do_EOF from completion and help.
[stefan]Quote newline characters between double quotes.
[stefan]Improve documentation and examples.
[stefan]Replace deprecatedpython setup.py testin tox.ini.
[stefan]Remove deprecatedtest_suitefrom setup.py.
[stefan]Remove setuptools frominstall_requires.
[stefan]Add a pyproject.toml file.
[stefan]Include tests in sdist but not in wheel.
[stefan]2.3 - 2019-03-20Clear lastcmd when EOF is hit to avoid an infinite loop. See Pythonissue 13500.
[stefan]Drop explicit GPL because the PSF license is GPL-compatible anyway.
[stefan]Update filename completion with new hooks.
[stefan]Stop hiding the quoting module in completions and make it available askmd.quoting.
[stefan]Stop usingrl.completer.resetbecause it overrides ~/.inputrc.
[stefan]Stop using 2to3.
[stefan]Require rl >= 3.0.
[stefan]2.2 - 2012-05-10String and filename quoting was not respected whenKmd.runwas called with arguments.
[stefan]Switch to a happier looking Sphinx theme.
[stefan]Require rl >= 2.2.
[stefan]2.1.2 - 2012-04-14Update documentation more.
[stefan]2.1.1 - 2012-03-29Update documentation.
[stefan]2.1 - 2011-11-05AddKmd.inputmethod as extension point for subclasses.
[stefan]Make sure hostname completion survives a missing hosts file.
[stefan]Require rl >= 2.0.1.
[stefan]2.0 - 2011-10-06AddKmd.aliasesdictionary to define command aliases.
[stefan]RefactorKmd.do_helpfor easier customization.
[stefan]Make sure error messages go to stderr.
[stefan]Switch to pretty Sphinx-based docs.
[stefan]Require rl >= 2.0.
[stefan]1.0 - 2011-07-14Initial release.