Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tehmaze/cli
Command Line Interface utilities
https://github.com/tehmaze/cli
Last synced: 9 days ago
JSON representation
Command Line Interface utilities
- Host: GitHub
- URL: https://github.com/tehmaze/cli
- Owner: tehmaze
- Created: 2011-03-03T20:45:41.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-11-25T10:52:12.000Z (almost 9 years ago)
- Last Synced: 2024-05-01T20:37:57.778Z (6 months ago)
- Language: Python
- Homepage:
- Size: 178 KB
- Stars: 8
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
========================
Command Line Interface
========================Framework for creating command line interfaces with basic readline
functionality.Usage
=====You can bind CLI to a terminal (console)::
>>> from cli import Console, CLI
>>> con = Console()
>>> cli = CLI(con)
>>> while True:
... cli.read()
...The ``Console`` class emulates a socket, you can also bind the CLI
to a (client) socket::>>> from cli import CLI
>>> import socket
>>> s = socket.socket()
>>> s.bind(('0.0.0.0', 12345))
>>> s.listen(1)
>>> c, a = s.accept()
>>> cli = CLI(c)
>>> while True:
... cli.read()
...Features
========* Both console and sockets are supported
* Tab completion
* History
- History search
- History completion
* Online help
TODO
====* History persistance