This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A library to manage command line interface for an application.

Project Description

A simple library to handle command line of an application with support for subcommands, as well as, automatic help text extraction from doc strings.

Supported platforms

  • python 2.7 / 3.4
  • Linux / Windows

Features

  • Decorator as well as subclass based command addition.
  • Custom help text formatter which improves upon the rather lousy default formatter.
  • Automatic help text extraction from doc strings.
  • Autocomplete support (Linux only).

Usage

A simple case of just the main command (without any subcommands):

from redcmd.api import maincmd, execute_commandline

@maincmd
def main(a, b):
        '''Add two numbers.
        a:      first number
        b:      second number

        This is where extra help text goes.
        It can be more than one line.'''

        try:
                print('sum: %d'%(int(a) + int(b)))
        except ValueError:
                print('bad integer')
                raise CommandError()

execute_commandline()

See examples directory in code for decorator and subclass based command handling. [https://github.com/amol9/redcmd/tree/master/examples]

Release History

Release History

This version
History Node

1.2.10

History Node

1.1.7

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
redcmd-1.2.10.tar.gz (24.1 kB) Copy SHA256 Checksum SHA256 Source May 11, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting